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