Add dev branch support to build workflow
dev push → artifact named fabledapp-dev-<sha> main push → artifact named fabledapp-<sha> tag push → artifact + Forgejo Release Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
# Runs on pushes to main and on version tags (v*).
|
# Branch push (dev): builds APK, uploads as artifact named fabledapp-dev-<sha>
|
||||||
#
|
# Branch push (main): builds APK, uploads as artifact named fabledapp-<sha>
|
||||||
# Branch push (main): builds APK, uploads as workflow artifact (30 day retention)
|
# Tag push (v26.03.09): builds APK, uploads artifact + creates Forgejo Release
|
||||||
# Tag push (v26.03.09): builds APK, creates a Forgejo Release with APK attached
|
|
||||||
#
|
#
|
||||||
# To cut a release:
|
# To cut a release:
|
||||||
# git tag v26.03.09 && git push origin v26.03.09
|
# git tag v26.03.09 && git push origin v26.03.09
|
||||||
@@ -12,7 +11,7 @@ name: Build APK
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main, dev]
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
paths:
|
paths:
|
||||||
- "lib/**"
|
- "lib/**"
|
||||||
@@ -37,10 +36,19 @@ jobs:
|
|||||||
- name: Build release APK
|
- name: Build release APK
|
||||||
run: flutter build apk --release
|
run: flutter build apk --release
|
||||||
|
|
||||||
|
- name: Set artifact name
|
||||||
|
id: artifact
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
|
||||||
|
echo "name=fabledapp-dev-${{ github.sha }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "name=fabledapp-${{ github.sha }}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: fabledapp-${{ github.sha }}
|
name: ${{ steps.artifact.outputs.name }}
|
||||||
path: build/app/outputs/flutter-apk/app-release.apk
|
path: build/app/outputs/flutter-apk/app-release.apk
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user