CI: build on RC* tags only, name the APK, and publish to a Gitea release
Build APK / build (push) Successful in 5m22s
Build APK / build (push) Successful in 5m22s
- Trigger on pushing a tag matching RC* instead of every push to main - tag the commit you want built: git tag RC1 && git push origin RC1 - Rename the built APK to Noo-<version>.apk (from pubspec.yaml's version) - Replace the plain artifact upload with akkuman/gitea-release-action, which creates/updates a Gitea release named after the triggering tag and attaches the versioned APK to it - the GitHub-flavored actions/upload-artifact and release actions don't reliably work against Gitea's own API, this one talks to Gitea natively Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+20
-10
@@ -1,9 +1,12 @@
|
||||
name: Build APK
|
||||
|
||||
# Deliberately not "on every push" - only when a release-candidate tag
|
||||
# (RC1, RC2, RC2026.1, ...) is pushed. Tag the commit you want built:
|
||||
# git tag RC1 && git push origin RC1
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "RC*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -43,12 +46,19 @@ jobs:
|
||||
- name: Build release APK
|
||||
run: flutter build apk --release
|
||||
|
||||
- name: Upload APK
|
||||
# v4 speaks a newer artifact protocol (Azure Blob-style) that
|
||||
# Gitea Actions doesn't implement yet - it errors as
|
||||
# "GHESNotSupportedError" even though this isn't GHES. v3 uses the
|
||||
# older protocol Gitea does support.
|
||||
uses: actions/upload-artifact@v3
|
||||
- name: Rename APK to Noo-<version>.apk
|
||||
run: |
|
||||
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | cut -d'+' -f1)
|
||||
mkdir -p release
|
||||
cp build/app/outputs/flutter-apk/app-release.apk "release/Noo-${VERSION}.apk"
|
||||
echo "APK_PATH=release/Noo-${VERSION}.apk" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Publish Gitea release with APK attached
|
||||
# Gitea-native release action (not GitHub's) - authenticates and
|
||||
# talks to this same Gitea instance automatically via the
|
||||
# `github.token`/`github.server_url` context Gitea Actions
|
||||
# provides for compatibility. Release is named/tagged after
|
||||
# whatever tag triggered this run (e.g. "RC1").
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
name: app-release-apk
|
||||
path: build/app/outputs/flutter-apk/app-release.apk
|
||||
files: ${{ env.APK_PATH }}
|
||||
|
||||
Reference in New Issue
Block a user