Host the action on Gitea
Workflows move to .gitea/workflows, which Gitea prefers over .github/workflows when both exist. GitHub Actions can only resolve `uses:` against github.com, so the README now spells out both forms: the full Gitea URL, and the checkout-then-`uses: ./` fallback for a GitHub workflow that has no mirror of this repository.
This commit is contained in:
36
.gitea/workflows/release.yml
Normal file
36
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*.*.*"]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
# Workflows pin `@v1`, so the major tag has to follow each release.
|
||||
major-tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# Needed to push the moved tag back; checkout leaves it in the git
|
||||
# config for the later push step.
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
|
||||
- name: Test before moving the tag
|
||||
run: node --test
|
||||
|
||||
- name: Move the major version tag
|
||||
run: |
|
||||
major="${GITHUB_REF_NAME%%.*}"
|
||||
git config user.name "gitea-actions"
|
||||
git config user.email "gitea-actions@noreply.localhost"
|
||||
git tag -f "$major" "$GITHUB_REF_NAME"
|
||||
git push origin "refs/tags/$major" --force
|
||||
echo "Moved $major to $GITHUB_REF_NAME"
|
||||
Reference in New Issue
Block a user