Archived
feat(ci): add scheduled auto-release workflow
Lint Markdown files / markdown-lint (push) Successful in 52s
Update Docker Hub Description / update-description-on-hub-docker-io (push) Successful in 16s
Build / build-arch-linux (push) Successful in 5m9s
Release / push-arch-linux (push) Successful in 7m44s
Release / sync-to-hub-docker-io (push) Successful in 8m0s
Lint Markdown files / markdown-lint (push) Successful in 52s
Update Docker Hub Description / update-description-on-hub-docker-io (push) Successful in 16s
Build / build-arch-linux (push) Successful in 5m9s
Release / push-arch-linux (push) Successful in 7m44s
Release / sync-to-hub-docker-io (push) Successful in 8m0s
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 <copilot@github.com>
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -4,12 +4,34 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "**"
|
- "**"
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: "Tag which should be released"
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push-arch-linux:
|
push-arch-linux:
|
||||||
runs-on: ubuntu-latest-amd64
|
runs-on: ubuntu-latest-amd64
|
||||||
steps:
|
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
|
- 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-qemu-action@v3.6.0
|
||||||
- uses: docker/setup-buildx-action@v3.10.0
|
- uses: docker/setup-buildx-action@v3.10.0
|
||||||
|
|
||||||
@@ -21,7 +43,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
run: |
|
run: |
|
||||||
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
|
TAG=${{ steps.version_extraction.outputs.version_cleaned }}
|
||||||
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--file Dockerfile.archlinux \
|
--file Dockerfile.archlinux \
|
||||||
@@ -34,9 +56,17 @@ jobs:
|
|||||||
- push-arch-linux
|
- push-arch-linux
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- name: Copy images to docker.io
|
||||||
run: |
|
run: |
|
||||||
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
|
TAG=${{ steps.version_extraction.outputs.version_cleaned }}
|
||||||
|
|
||||||
apt-get update --yes
|
apt-get update --yes
|
||||||
apt-get install --yes skopeo
|
apt-get install --yes skopeo
|
||||||
|
|||||||
@@ -24,11 +24,12 @@ 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.
|
root directory of your Latex files or change the `volume` option with the `${PWD}` variable.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker run \
|
$ podman run \
|
||||||
--rm \
|
--rm \
|
||||||
--user="$(shell id -u):$(shell id -g)" \
|
|
||||||
--net="none" \
|
--net="none" \
|
||||||
--volume="${PWD}:/workspace" git.cryptic.systems/volker.raschek/latex:latest-archlinux \
|
--workdir="${PWD}" \
|
||||||
|
--volume="${PWD}:${PWD}" \
|
||||||
|
git.cryptic.systems/volker.raschek/latex:latest-archlinux \
|
||||||
latexmk \
|
latexmk \
|
||||||
-shell-escape \
|
-shell-escape \
|
||||||
-synctex=1 \
|
-synctex=1 \
|
||||||
@@ -43,11 +44,12 @@ 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.
|
your root directory of your Latex files or change the `volume` option with the `${PWD}` variable.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker run \
|
$ podman run \
|
||||||
--rm \
|
--rm \
|
||||||
--user="$(shell id -u):$(shell id -g)" \
|
|
||||||
--net="none" \
|
--net="none" \
|
||||||
--volume="${PWD}:/workspace" git.cryptic.systems/volker.raschek/latex:latest-archlinux \
|
--workdir="${PWD}" \
|
||||||
|
--volume="${PWD}:${PWD}" \
|
||||||
|
git.cryptic.systems/volker.raschek/latex:latest-archlinux \
|
||||||
pdflatex \
|
pdflatex \
|
||||||
-shell-escape \
|
-shell-escape \
|
||||||
-synctex=1 \
|
-synctex=1 \
|
||||||
|
|||||||
@@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user