Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6304ad7e24 | ||
|
|
483cc23dea |
No files matched your search
@@ -1,10 +1,16 @@
|
|||||||
name: Promote → GitHub
|
name: Promote → GitHub
|
||||||
|
|
||||||
# Runs on GITEA ONLY. Mirrors only main + version tags to the public GitHub repo.
|
# Runs on GITEA ONLY. Mirrors `main` to the public GitHub repo.
|
||||||
|
#
|
||||||
|
# Tags are NOT promoted here. They are promoted by release.yml's `promote-tag`
|
||||||
|
# job, which waits for this forge's builds to pass first — pushing a tag is what
|
||||||
|
# starts GitHub's release and its crates.io publish, and crates.io cannot be
|
||||||
|
# unpublished, only yanked. Both workflows used to fire on the same tag push, so
|
||||||
|
# Gitea built and GitHub published at the same time and this forge was never the
|
||||||
|
# check it was meant to be.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
tags: ['v*']
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push-github:
|
push-github:
|
||||||
@@ -14,14 +20,17 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Push main + tags to GitHub
|
- name: Push main to GitHub
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/matcha.git"
|
git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/matcha.git"
|
||||||
if [ "${{ github.ref_type }}" = "tag" ]; then
|
# Deliberately not `--tags`. v26.7.0 points at a different commit on
|
||||||
git push github "refs/tags/${{ github.ref_name }}"
|
# each forge and v26.8.0-beta.0 is annotated here and lightweight
|
||||||
else
|
# there, so pushing every tag is a non-fast-forward that fails — which
|
||||||
git push github "HEAD:refs/heads/main"
|
# it has been doing on every push to main, reddening a job whose real
|
||||||
git push github --tags
|
# work (the line above) had already succeeded. Reconciling that
|
||||||
fi
|
# divergence means rewriting what a published tag points at, which is
|
||||||
|
# a decision rather than a fix; new tags are unaffected and go through
|
||||||
|
# release.yml.
|
||||||
|
git push github "HEAD:refs/heads/main"
|
||||||
@@ -172,6 +172,34 @@ jobs:
|
|||||||
"$PWD/.bin/matcha" --version
|
"$PWD/.bin/matcha" --version
|
||||||
"$PWD/.bin/matcha" --help > /dev/null
|
"$PWD/.bin/matcha" --help > /dev/null
|
||||||
|
|
||||||
|
# Gitea only: hand the tag to GitHub, but only once this forge has built all
|
||||||
|
# four targets and run every artifact it can.
|
||||||
|
#
|
||||||
|
# This is the gate. Pushing the tag is what starts GitHub's release and, with
|
||||||
|
# it, the crates.io publish — and crates.io has no unpublish, only yank. So the
|
||||||
|
# local build is not a parallel opinion, it is the thing that has to pass
|
||||||
|
# first. `needs: build` is what makes the two sequential; when both workflows
|
||||||
|
# fired on the same tag push they were not.
|
||||||
|
promote-tag:
|
||||||
|
needs: build
|
||||||
|
if: ${{ github.server_url != 'https://github.com' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Push the tag to GitHub
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/matcha.git"
|
||||||
|
# `${{ github.ref_name }}` rather than $GITHUB_REF_NAME: the expression
|
||||||
|
# is what promote.yml used to hand v26.8.0-beta.0 to GitHub, so it is
|
||||||
|
# proven on this act_runner. Whether the env var is exported here is
|
||||||
|
# not, and getting it wrong would push an empty ref and leave the tag
|
||||||
|
# on this forge alone.
|
||||||
|
git push github "refs/tags/${{ github.ref_name }}"
|
||||||
|
|
||||||
# crates.io = production only.
|
# crates.io = production only.
|
||||||
# crates.io = production only, via OIDC Trusted Publishing (no CARGO_TOKEN).
|
# crates.io = production only, via OIDC Trusted Publishing (no CARGO_TOKEN).
|
||||||
# Requires a trusted publisher configured on crates.io (Expressive-Tea/matcha, release.yml).
|
# Requires a trusted publisher configured on crates.io (Expressive-Tea/matcha, release.yml).
|
||||||
|
|||||||
Reference in new issue
Block a user