906eb80ce5
test-go / test (pull_request) Successful in 33s
test-web / test (pull_request) Successful in 32s
android / Build + lint + test (push) Successful in 4m43s
android / Build signed release APK (push) Has been skipped
android / Build + lint + test (pull_request) Successful in 5m9s
android / Build signed release APK (pull_request) Has been skipped
test-go / integration (pull_request) Successful in 12m14s
Two related cutover changes so the rolling stable channel works end to end after the Flutter sunset. release.yml: - Main pushes now tag both :main and :latest. Main is the protected post-PR-merge branch and the team's stable channel; pinning to :latest gets the newest main automatically while :vX.Y.Z stays available for pinned consumers. android.yml: - Asset attach renamed from minstrel-android-<tag>.apk to minstrel-<tag>.apk (M8 phase 14.4 cutover). Without this, the server image's bundled in-app-update fetcher in release.yml polls a filename that no workflow produces, so /api/client/version returns 404 and the web UI's MobileAppDownload silently renders nothing. With this rename the existing fetcher resolves to the native APK with no further plumbing. No code paths change; both fixes are workflow rewires.
108 lines
4.0 KiB
YAML
108 lines
4.0 KiB
YAML
name: release
|
|
|
|
# Builds and pushes the minstrel container image to the Gitea registry.
|
|
#
|
|
# push to main → :main and :latest
|
|
# push tag vX.Y.Z → :vX.Y.Z and :latest
|
|
# workflow_dispatch → manual trigger (same rules based on the ref)
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
# Tag pushes still build (tag releases are intentional, server + Flutter
|
|
# share the version). Branch pushes skip when the diff is Flutter-only —
|
|
# rebuilding the Go image for a Flutter-only merge wastes CI and churns
|
|
# the registry.
|
|
paths-ignore:
|
|
- 'flutter_client/**'
|
|
- 'docs/**'
|
|
- '**/*.md'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: go-ci
|
|
container:
|
|
image: git.fabledsword.com/bvandeusen/ci-go:1.26
|
|
|
|
env:
|
|
IMAGE: git.fabledsword.com/bvandeusen/minstrel
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Detect buildable project
|
|
id: guard
|
|
shell: bash
|
|
run: |
|
|
if [ -f Dockerfile ] && [ -f go.mod ]; then
|
|
echo "ready=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "ready=false" >> "$GITHUB_OUTPUT"
|
|
echo "::notice::No Dockerfile + go.mod yet — release build skipped"
|
|
fi
|
|
|
|
- name: Compute image tags
|
|
id: tags
|
|
if: steps.guard.outputs.ready == 'true'
|
|
shell: bash
|
|
run: |
|
|
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
|
|
VERSION="${GITHUB_REF#refs/tags/}"
|
|
echo "args=-t ${IMAGE}:${VERSION} -t ${IMAGE}:latest" >> "$GITHUB_OUTPUT"
|
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
echo "::notice::Release build: ${VERSION} + latest"
|
|
else
|
|
# Main is the protected, post-PR-merge branch. Treat it as the
|
|
# rolling stable channel — every main push moves :latest.
|
|
# Pinned consumers can target :vX.Y.Z; everyone else gets the
|
|
# newest main.
|
|
echo "args=-t ${IMAGE}:main -t ${IMAGE}:latest" >> "$GITHUB_OUTPUT"
|
|
echo "version=main" >> "$GITHUB_OUTPUT"
|
|
echo "::notice::Main-branch build: :main + :latest"
|
|
fi
|
|
|
|
- name: Registry login
|
|
if: steps.guard.outputs.ready == 'true'
|
|
shell: bash
|
|
run: |
|
|
echo "${{ secrets.CI_TOKEN }}" \
|
|
| docker login git.fabledsword.com -u "${{ github.actor }}" --password-stdin
|
|
|
|
# In-app update flow (#397): on tag pushes only, fetch the APK
|
|
# that flutter.yml is attaching to this same release. flutter.yml
|
|
# runs in parallel; poll up to 15 min for the asset to appear.
|
|
# On main pushes (or if the APK never lands), client/ stays empty
|
|
# and the endpoints return 404 — graceful degradation.
|
|
- name: Fetch APK for bundled in-app update channel
|
|
if: steps.guard.outputs.ready == 'true' && startsWith(github.ref, 'refs/tags/v')
|
|
shell: bash
|
|
env:
|
|
CI_TOKEN: ${{ secrets.CI_TOKEN }}
|
|
run: |
|
|
TAG="${GITHUB_REF#refs/tags/}"
|
|
REPO="${GITHUB_REPOSITORY}"
|
|
APK_URL="https://git.fabledsword.com/${REPO}/releases/download/${TAG}/minstrel-${TAG}.apk"
|
|
echo "Polling ${APK_URL} (up to 15 min for flutter.yml to attach)..."
|
|
for i in $(seq 1 30); do
|
|
if curl -fsSL -H "Authorization: token ${CI_TOKEN}" \
|
|
-o client/minstrel.apk "$APK_URL"; then
|
|
echo "Got APK on attempt $i"
|
|
echo "${TAG}" > client/minstrel.apk.version
|
|
ls -lh client/
|
|
exit 0
|
|
fi
|
|
echo "APK not ready yet (attempt $i/30), sleeping 30s..."
|
|
sleep 30
|
|
done
|
|
echo "::warning::APK never appeared at ${APK_URL} after 15 min — image will ship without bundled update channel"
|
|
|
|
- name: Build and push
|
|
if: steps.guard.outputs.ready == 'true'
|
|
run: |
|
|
docker buildx build \
|
|
--build-arg MINSTREL_VERSION="${{ steps.tags.outputs.version }}" \
|
|
--push ${{ steps.tags.outputs.args }} .
|