Merge tag job into CI, remove separate release workflow
Assisted-by: GLM-5 via pi
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index 960cbe6..91c066b 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -50,3 +50,37 @@ jobs:
# Can't use zizmorcore/zizmor-action because it doesn't support
# auditing .gitea/workflows/ — it rejects them as invalid inputs.
- run: zizmor .gitea/workflows/* .github
+
+ tag:
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
+ needs: [ci]
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 # zizmor: ignore[artipacked] -- needs credentials to push tag
+ with:
+ fetch-depth: 0
+
+ - name: Calculate version
+ id: version
+ run: |
+ CALVER=$(date -u +"%Y-%m-%d")
+ SHORT_SHA=$(git rev-parse --short HEAD)
+ VERSION="${CALVER}+${SHORT_SHA}"
+ echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
+
+ - name: Push tag
+ env:
+ VERSION: ${{ steps.version.outputs.version }}
+ run: |
+ TAG="v${VERSION}"
+
+ # Skip if this tag already exists
+ if git tag -l "$TAG" | grep -q .; then
+ echo "Tag ${TAG} already exists, skipping"
+ exit 0
+ fi
+
+ git tag "$TAG"
+ git push origin "$TAG"
diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml
deleted file mode 100644
index 2053429..0000000
--- a/.gitea/workflows/release.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: Tag release
-
-on: # zizmor: ignore[dangerous-triggers] -- scoped to main branch only, checks CI conclusion
- workflow_run:
- workflows: [CI]
- types: [completed]
- branches: [main]
- workflow_dispatch:
-
-permissions:
- contents: write
-
-jobs:
- tag:
- if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- with:
- fetch-depth: 0
- persist-credentials: false
-
- - name: Calculate version
- id: version
- run: |
- CALVER=$(date -u +"%Y-%m-%d")
- SHORT_SHA=$(git rev-parse --short HEAD)
- VERSION="${CALVER}+${SHORT_SHA}"
- echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
-
- - name: Push tag
- env:
- VERSION: ${{ steps.version.outputs.version }}
- run: |
- TAG="v${VERSION}"
-
- # Skip if this tag already exists
- if git tag -l "$TAG" | grep -q .; then
- echo "Tag ${TAG} already exists, skipping"
- exit 0
- fi
-
- git tag "$TAG"
- git push origin "$TAG"