From e5a5630ef8d91a49de18bf5c3505dd724717ffe4 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Fri, 21 Aug 2026 09:45:28 +0200 Subject: [PATCH] feat(ci): add scheduled auto-release workflow Introduce a cron-triggered auto-release workflow that runs on the second Sunday of each month, creating a time-based tag in YYYY-MM format and dispatching the release workflow. The release workflow is extended with a workflow_dispatch trigger accepting a tag input, so it can be invoked both by tag pushes and programmatically by the auto-release. Version extraction is unified via a dedicated step using `inputs.tag || github.ref_name` in both jobs. Co-authored-by: Copilot --- .gitea/workflows/auto-release.yaml | 53 ++++++++++++++++++++++++++++++ .gitea/workflows/release.yaml | 34 +++++++++++++++++-- README.md | 36 ++++++++++---------- renovate.json | 9 +++++ 4 files changed, 113 insertions(+), 19 deletions(-) create mode 100644 .gitea/workflows/auto-release.yaml create mode 100644 renovate.json diff --git a/.gitea/workflows/auto-release.yaml b/.gitea/workflows/auto-release.yaml new file mode 100644 index 0000000..3783dd7 --- /dev/null +++ b/.gitea/workflows/auto-release.yaml @@ -0,0 +1,53 @@ +name: Auto release tagged + +on: + schedule: + # Second Sunday of every month at 00:00 UTC + - cron: "0 0 8-14 * 0" + +env: + GIT_EMAIL: noreply@cryptic.systems + GIT_USER: CSRBot + +jobs: + create_tag_and_release: + permissions: + actions: write + contents: write + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + + - name: Create and push new tag + id: create_tag + run: | + defined_tag="$(date -u +"%Y-%m")" + + echo "defined_tag=${defined_tag}" >> $GITHUB_OUTPUT + echo "New tag: ${defined_tag}" + + git config --local user.name "${GIT_USER}" + git config --local user.email "${GIT_EMAIL}" + git tag -a "${defined_tag}" -m "${defined_tag}" + git push origin "${defined_tag}" + + - name: Trigger "Release" workflow + uses: actions/github-script@v7.0.1 + with: + script: | + const workflowFileName = 'release.yaml'; + const defaultBranch = context.payload.repository.default_branch; + const definedTag = '${{ steps.create_tag.outputs.defined_tag }}'; + + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: workflowFileName, + ref: defaultBranch, + inputs: { + tag: definedTag + } + }); diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 279702e..e882d3c 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -4,12 +4,34 @@ on: push: tags: - "**" + workflow_dispatch: + inputs: + tag: + description: "Tag which should be released" + type: string + required: true jobs: push-arch-linux: runs-on: ubuntu-latest-amd64 steps: + - id: version_extraction + name: Extract git tag + run: | + VERSION="${{ inputs.tag || github.ref_name }}" + VERSION="${VERSION#refs/*/}" + + echo "Version (raw): ${VERSION}" + echo "Version (cleaned): ${VERSION/v/}" + + echo "version_raw=${VERSION}" >> $GITHUB_OUTPUT + echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4.2.2 + with: + fetch-tags: true + ref: "${{ steps.version_extraction.outputs.version_raw }}" + - uses: docker/setup-qemu-action@v3.6.0 - uses: docker/setup-buildx-action@v3.10.0 @@ -21,7 +43,7 @@ jobs: - name: Build and push image run: | - TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm') + TAG=${{ steps.version_extraction.outputs.version_cleaned }} docker buildx build \ --file Dockerfile.archlinux \ @@ -34,9 +56,17 @@ jobs: - push-arch-linux runs-on: ubuntu-latest steps: + - id: version_extraction + name: Extract git tag + run: | + VERSION="${{ inputs.tag || github.ref_name }}" + VERSION="${VERSION#refs/*/}" + + echo "version_cleaned=${VERSION/v/}" >> $GITHUB_OUTPUT + - name: Copy images to docker.io run: | - TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm') + TAG=${{ steps.version_extraction.outputs.version_cleaned }} apt-get update --yes apt-get install --yes skopeo diff --git a/README.md b/README.md index d6f89d5..73d0633 100644 --- a/README.md +++ b/README.md @@ -24,17 +24,18 @@ Here is an example based on ubuntu 18.04 to compile a PDF file with `latexmk` fr root directory of your Latex files or change the `volume` option with the `${PWD}` variable. ```bash -$ docker run \ +$ podman run \ --rm \ - --user="$(shell id -u):$(shell id -g)" \ --net="none" \ - --volume="${PWD}:/workspace" git.cryptic.systems/volker.raschek/latex:latest-archlinux \ - latexmk \ - -shell-escape \ - -synctex=1 \ - -interaction=nonstopmode \ - -file-line-error \ - -pdf index.tex + --workdir="${PWD}" \ + --volume="${PWD}:${PWD}" \ + git.cryptic.systems/volker.raschek/latex:latest-archlinux \ + latexmk \ + -shell-escape \ + -synctex=1 \ + -interaction=nonstopmode \ + -file-line-error \ + -pdf index.tex ``` ### pdflatex @@ -43,14 +44,15 @@ Here is a example based on ubuntu 18.04 to compile a PDF file with `pdflatex` fr your root directory of your Latex files or change the `volume` option with the `${PWD}` variable. ```bash -$ docker run \ +$ podman run \ --rm \ - --user="$(shell id -u):$(shell id -g)" \ --net="none" \ - --volume="${PWD}:/workspace" git.cryptic.systems/volker.raschek/latex:latest-archlinux \ - pdflatex \ - -shell-escape \ - -synctex=1 \ - -interaction=nonstopmode \ - -enable-write18 index.tex + --workdir="${PWD}" \ + --volume="${PWD}:${PWD}" \ + git.cryptic.systems/volker.raschek/latex:latest-archlinux \ + pdflatex \ + -shell-escape \ + -synctex=1 \ + -interaction=nonstopmode \ + -enable-write18 index.tex ``` diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..84f88f7 --- /dev/null +++ b/renovate.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>volker.raschek/renovate-config:default#master", + "local>volker.raschek/renovate-config:container#master", + "local>volker.raschek/renovate-config:actions#master", + "local>volker.raschek/renovate-config:regexp#master" + ] +} \ No newline at end of file