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
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
tags:
|
||||||
- main
|
- "RC*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -43,12 +46,19 @@ jobs:
|
|||||||
- name: Build release APK
|
- name: Build release APK
|
||||||
run: flutter build apk --release
|
run: flutter build apk --release
|
||||||
|
|
||||||
- name: Upload APK
|
- name: Rename APK to Noo-<version>.apk
|
||||||
# v4 speaks a newer artifact protocol (Azure Blob-style) that
|
run: |
|
||||||
# Gitea Actions doesn't implement yet - it errors as
|
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | cut -d'+' -f1)
|
||||||
# "GHESNotSupportedError" even though this isn't GHES. v3 uses the
|
mkdir -p release
|
||||||
# older protocol Gitea does support.
|
cp build/app/outputs/flutter-apk/app-release.apk "release/Noo-${VERSION}.apk"
|
||||||
uses: actions/upload-artifact@v3
|
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:
|
with:
|
||||||
name: app-release-apk
|
files: ${{ env.APK_PATH }}
|
||||||
path: build/app/outputs/flutter-apk/app-release.apk
|
|
||||||
|
|||||||
Reference in New Issue
Block a user