Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02fb5f1012 | |||
|
c9a31ba468
|
@@ -1,5 +1,10 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on: [push]
|
# Restrict to branch pushes: an unfiltered `push` also fires for tag refs,
|
||||||
|
# including the vendor-release tags the bump script creates via the API.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Lint gate: runs on the plain Docker-backend runner (not the Gentoo
|
# Lint gate: runs on the plain Docker-backend runner (not the Gentoo
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
name: Vendor tags
|
||||||
|
# The bump script creates the `${PN}-${ver}-vendor` release (which hosts the
|
||||||
|
# vendor tarball) *before* the bump commit exists, so its tag can only point at
|
||||||
|
# whatever master was at the time. The PR is then squash/rebase-merged, so the
|
||||||
|
# branch commit never lands on master either. This job re-points each vendor
|
||||||
|
# tag at the master commit that introduced that version's ebuild. It is
|
||||||
|
# idempotent: a tag already on the right commit is left alone.
|
||||||
|
#
|
||||||
|
# Only ever force-*update* a tag here. Deleting a release's tag makes Gitea
|
||||||
|
# delete the release and its assets, which would break the ebuild's SRC_URI.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- 'dev-util/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
repoint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Point vendor tags at their bump commits
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
git fetch --tags --force origin
|
||||||
|
for ebuild in dev-util/gitea-runner/gitea-runner-*.ebuild; do
|
||||||
|
ver=${ebuild##*/gitea-runner-}; ver=${ver%.ebuild}
|
||||||
|
tag="gitea-runner-${ver}-vendor"
|
||||||
|
if ! cur=$(git rev-parse --verify -q "refs/tags/${tag}^{commit}"); then
|
||||||
|
echo "${tag}: no such tag, skipping"; continue
|
||||||
|
fi
|
||||||
|
# git mv shows up as an addition of the new path (no --follow).
|
||||||
|
target=$(git log --diff-filter=A --format=%H -1 -- "$ebuild")
|
||||||
|
if [ "$cur" = "$target" ]; then
|
||||||
|
echo "${tag}: already at ${target}"; continue
|
||||||
|
fi
|
||||||
|
echo "${tag}: ${cur} -> ${target}"
|
||||||
|
git push --force origin "${target}:refs/tags/${tag}"
|
||||||
|
done
|
||||||
@@ -52,8 +52,9 @@ re-uploaded as a release asset, or the build will fail Manifest verification. Th
|
|||||||
4. `git mv`s the ebuild to the new version, rewrites `BDEPEND`'s Go version from
|
4. `git mv`s the ebuild to the new version, rewrites `BDEPEND`'s Go version from
|
||||||
upstream `go.mod`, and regenerates the Manifest with `pkgdev manifest` (after copying
|
upstream `go.mod`, and regenerates the Manifest with `pkgdev manifest` (after copying
|
||||||
both distfiles into `/var/cache/distfiles` and wiring a temporary `repos.conf`).
|
both distfiles into `/var/cache/distfiles` and wiring a temporary `repos.conf`).
|
||||||
5. Validates: `pkgcheck scan`, then `emerge` + `gitea-runner --version | grep v${ver}`.
|
5. Commits, pushes the branch, opens a PR against `master`. The script does **not**
|
||||||
6. Commits, pushes the branch, opens a PR against `master`.
|
emerge or pkgcheck the result itself: the branch push triggers CI, which does both
|
||||||
|
(and fetches the real release asset, which the script's local copy never would).
|
||||||
|
|
||||||
Requires a `BUMP_TOKEN` repo secret (scopes: repository read/write, write release) plus
|
Requires a `BUMP_TOKEN` repo secret (scopes: repository read/write, write release) plus
|
||||||
a Gentoo env with `go pkgdev git curl xz jq`.
|
a Gentoo env with `go pkgdev git curl xz jq`.
|
||||||
@@ -74,6 +75,17 @@ runner executes JS actions by `docker exec node …` *inside* the job container,
|
|||||||
`gentoo/stage3` ships no node, so any JS action fails with exit 127. The lint job has no
|
`gentoo/stage3` ships no node, so any JS action fails with exit 127. The lint job has no
|
||||||
`container:`, so it runs in the runner's default node-capable image and checkout works.
|
`container:`, so it runs in the runner's default node-capable image and checkout works.
|
||||||
|
|
||||||
|
## Vendor-tag repointing (`.gitea/workflows/vendor-tags.yaml`)
|
||||||
|
|
||||||
|
The bump script creates the `${PN}-${ver}-vendor` release before the bump commit
|
||||||
|
exists, so its tag points at whatever `master` was at the time (and squash/rebase
|
||||||
|
merges mean the branch commit never lands on `master` anyway). On every push to
|
||||||
|
`master` touching `dev-util/**`, this workflow force-updates each vendor tag whose
|
||||||
|
ebuild is still in the tree to the `master` commit that added that ebuild. It only
|
||||||
|
ever *updates* tags: deleting a release's tag makes Gitea delete the release and its
|
||||||
|
assets, breaking the ebuild's `SRC_URI`. Tag pushes don't re-trigger CI because
|
||||||
|
`ci.yaml` is filtered to branch pushes.
|
||||||
|
|
||||||
## Conventions / gotchas
|
## Conventions / gotchas
|
||||||
|
|
||||||
- **YAML** is linted by `.yamllint.yaml` (relaxed: line-length and document-start
|
- **YAML** is linted by `.yamllint.yaml` (relaxed: line-length and document-start
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
DIST gitea-runner-3.3.1-vendor.tar.xz 3273532 BLAKE2B 376e88938aef1a945ca2da00f23d3320e5ab7efdaa539f3825aed104b3eab4c965359b1bef602613fb0e236d089146f14449fba4d0ba54a60062edb6aeae66a3 SHA512 92e202990a6e501205d7068a305e123442887263d1967b3ec3a38480b2e5f65592887a14ac861bfebf5c71060daab914bb38edd25f373e1414ebfda745bc367b
|
DIST gitea-runner-3.3.2-vendor.tar.xz 3273532 BLAKE2B 376e88938aef1a945ca2da00f23d3320e5ab7efdaa539f3825aed104b3eab4c965359b1bef602613fb0e236d089146f14449fba4d0ba54a60062edb6aeae66a3 SHA512 92e202990a6e501205d7068a305e123442887263d1967b3ec3a38480b2e5f65592887a14ac861bfebf5c71060daab914bb38edd25f373e1414ebfda745bc367b
|
||||||
DIST gitea-runner-3.3.1.tar.gz 478550 BLAKE2B 46264b168e1579b4b5408974a6c3d16486fae4c087911697b1afa3cd72fbb9570b81f749902fd9dd9355deae2bd8661d3526105ab2d24bfcddda2254d88f3356 SHA512 86d9e53a12411a9aab46d2db529ac4382f0d4e4fcd4af38c7237686638e6a9c8e393b94f27a09d8292c6cd20a33a16fdeb728631aa75bbb752358aee8f753716
|
DIST gitea-runner-3.3.2.tar.gz 485524 BLAKE2B 691b9f1d051a4879bc32b5d858123c7b13a92ce87ee27127e47ee0a7608a2208799a13d6bfb529889d6f083116d396a8d6abf5da5ae8d169fe216ff0ac9efcc9 SHA512 a0d86250da07262e654c7b9fafbbeeb2691e21ea76992bf555b2a57155ee8f60ea5fe436dc067af992ae9892a23fec208ca60802bc7fdf7fd81bb45d2d73c091
|
||||||
|
|||||||
@@ -120,13 +120,10 @@ printf '[azy5030]\nlocation = %s\nmasters = gentoo\nauto-sync = false\n' "$WORK"
|
|||||||
> /etc/portage/repos.conf/azy5030.conf
|
> /etc/portage/repos.conf/azy5030.conf
|
||||||
( cd "${pkgdir}" && pkgdev manifest )
|
( cd "${pkgdir}" && pkgdev manifest )
|
||||||
|
|
||||||
# --- validate, commit, push, open PR ----------------------------------------
|
# --- commit, push, open PR ---------------------------------------------------
|
||||||
pkgcheck scan --repo "$WORK" "${pkgdir}" || true
|
# No emerge/pkgcheck here: pushing the branch triggers CI, which runs pkgcheck,
|
||||||
mkdir -p /etc/portage/package.accept_keywords
|
# builds the package from the Manifest (fetching the real release asset) and
|
||||||
echo 'dev-util/gitea-runner ~amd64' > /etc/portage/package.accept_keywords/gitea-runner
|
# asserts `gitea-runner --version`. A broken release shows up as a red PR.
|
||||||
emerge -v --getbinpkg "=dev-util/${PN}-${latest}"
|
|
||||||
gitea-runner --version | grep -q "v${latest}"
|
|
||||||
|
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "dev-util/${PN}: bump to ${latest}"
|
git commit -m "dev-util/${PN}: bump to ${latest}"
|
||||||
git push origin "$branch"
|
git push origin "$branch"
|
||||||
@@ -141,8 +138,7 @@ Review checklist:
|
|||||||
- [ ] LICENSE still covers all vendored module licenses (\`go-licenses report ./...\`)
|
- [ ] LICENSE still covers all vendored module licenses (\`go-licenses report ./...\`)
|
||||||
- [ ] BDEPEND Go version matches upstream go.mod (set to >=${goreq:-unchanged})
|
- [ ] BDEPEND Go version matches upstream go.mod (set to >=${goreq:-unchanged})
|
||||||
- [ ] version ldflags path \`internal/pkg/ver.version\` unchanged upstream
|
- [ ] version ldflags path \`internal/pkg/ver.version\` unchanged upstream
|
||||||
|
- [ ] CI (pkgcheck + emerge + \`gitea-runner --version\`) is green on this PR
|
||||||
CI build + \`gitea-runner --version\` passed in this workflow.
|
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
api -X POST -H 'Content-Type: application/json' \
|
api -X POST -H 'Content-Type: application/json' \
|
||||||
|
|||||||
Reference in New Issue
Block a user