Compare commits

...
Author SHA1 Message Date
tequ 60f35efddf ci: report published build version as a commit status
build-core.sh only echoed the published version (e.g. 2026.10.24-HEAD+4205)
into the Docker build log, so finding it for a PR meant opening the
release build workflow log. Write it to release-build/version and post it
as a commit status on the PR head commit, with a link to the binary on
build.xahau.tech.

The status step is continue-on-error because fork PRs get a read-only
GITHUB_TOKEN.
2026-10-26 23:23:07 +09:00
2 changed files with 23 additions and 1 deletions

No files matched your search

+22
View File
@@ -38,6 +38,9 @@ jobs:
build:
runs-on: [self-hosted, xahaud-build]
needs: [checkout]
permissions:
contents: read
statuses: write
defaults:
run:
working-directory: ${{ needs.checkout.outputs.checkout_path }}
@@ -49,6 +52,25 @@ jobs:
- name: Build using Docker
run: /bin/bash release-builder.sh
# Shows the published binary version (e.g. 2026.10.24-HEAD+4205) in the
# PR merge box so nobody has to dig it out of the build log.
- name: Report build version as commit status
# Fork PRs get a read-only GITHUB_TOKEN; never fail the build over this.
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
# On pull_request github.sha is the merge commit; the PR page shows
# statuses of the head commit.
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
BUILD_DIR: ${{ github.ref_name == 'release' && 'candidate/' || '' }}
run: |
VERSION=$(cat release-build/version)
curl -sSf -X POST \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/statuses/$SHA" \
-d "{\"state\":\"success\",\"context\":\"xahaud build\",\"description\":\"$VERSION\",\"target_url\":\"http://build.xahau.tech/${BUILD_DIR}${VERSION}\"}"
- name: Stop Container (Cleanup)
if: always()
run: |
+1 -1
View File
@@ -106,7 +106,7 @@ else
cp /io/release-build/release.info /data/builds/$(date +%Y).$(date +%-m).$(date +%-d)-$(git rev-parse --abbrev-ref HEAD)+$4.releaseinfo
fi
echo "Published build to: http://build.xahau.tech/"
echo $(date +%Y).$(date +%-m).$(date +%-d)-$(git rev-parse --abbrev-ref HEAD)+$4
echo $(date +%Y).$(date +%-m).$(date +%-d)-$(git rev-parse --abbrev-ref HEAD)+$4 | tee /io/release-build/version
fi
cd ..;