From da22030d435744a38d09ef66541256527062182f Mon Sep 17 00:00:00 2001 From: ayushya Date: Wed, 16 Sep 2026 15:17:49 -0400 Subject: [PATCH] CI: build on RC* tags only, name the APK, and publish to a Gitea release - 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-.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 --- .gitea/workflows/build.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 690a113..d9f22c2 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -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-.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 }}