Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e2f2b4e
👷 Simplify artifact up and downloading
Friedinger Apr 29, 2026
9551fab
👷 Fix working directory path
Friedinger Apr 29, 2026
04a1406
👷 Update artifact paths without globs
Friedinger Apr 29, 2026
134f594
Merge branch 'refs/heads/main' into ci/simplify-artifacts
Friedinger Apr 29, 2026
fe195df
👷 Fix working directory paths
Friedinger Apr 29, 2026
060ed7f
👷 Update symbols path to use working directory input
Friedinger Apr 29, 2026
6c659f7
👷 Fix artifact names
Friedinger Apr 29, 2026
66d552f
👷 Simplify artifact handling by adjusting download path and removing …
Friedinger Apr 29, 2026
54cfe38
👷 Release all release assets
Friedinger Apr 29, 2026
8b05aa4
👷 Create test releases
Friedinger Apr 29, 2026
16c0e8c
👷 Add option to skip updating pubspec version number
Friedinger Apr 29, 2026
e42e2f8
📝 Document skip-version-update input
Friedinger Apr 29, 2026
2fde33a
👷 Use boolean checks for skip-version-update input
Friedinger Apr 29, 2026
41a91b8
👷 Fix if syntax
Friedinger Apr 29, 2026
ca5ea41
👷 Cleanup previous test release
Friedinger Apr 29, 2026
71917aa
👷 Fix release version envs
Friedinger Apr 29, 2026
3000da1
👷 Add github token to use gh cli
Friedinger Apr 29, 2026
5f44303
👷 Add missing repo checkout
Friedinger Apr 29, 2026
e3deb93
🔧 Add .gitattributes
Friedinger Apr 29, 2026
0ed2f47
👷 Add accidentally removed pubversion set
Friedinger Apr 29, 2026
1401d60
⚰️ Remove dead code
Friedinger Apr 29, 2026
06c839d
👷 Fix version name
Friedinger Apr 29, 2026
49010a5
👷 Update refname replace
Friedinger Apr 29, 2026
78b0514
🐛 Fix replacing version name
Friedinger Apr 29, 2026
d5dcae6
🔊 Log build options
Friedinger Apr 29, 2026
17501f9
🐛 Add missing path for pubspec download
Friedinger Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
13 changes: 13 additions & 0 deletions .github/workflows/close-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,16 @@ jobs:
issues: write
pull-requests: write
actions: write

cleanup:
name: Cleanup from previous test runs
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Delete previous test release
env:
GH_TOKEN: ${{ github.token }}
run: gh release delete vtest-${{ github.ref_name }} --cleanup-tag -y || echo "No previous release to delete"
Comment thread
Friedinger marked this conversation as resolved.
21 changes: 16 additions & 5 deletions .github/workflows/test-app-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: Test App Workflow
on:
push:
branches: [main]
paths:
- "test_app/**"
- ".github/workflows/test-app-workflow.yml"
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
Expand All @@ -24,10 +21,24 @@ permissions:
pull-requests: write

jobs:
test-app:
cleanup:
name: Cleanup from previous test runs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Delete previous test release
env:
GH_TOKEN: ${{ github.token }}
run: gh release delete vtest-${{ github.ref_name }} --cleanup-tag -y || echo "No previous release to delete"

test:
uses: ./.github/workflows/workflow-build.yml
with:
app-name: "test_app"
build-type: ${{ github.event.inputs['build-type'] || 'build' }}
build-type: ${{ github.event.inputs['build-type'] || 'release' }}
release-version: "test-${{ github.ref_name }}"
working-directory: "test_app"
java-version: "21"
skip-version-update: true
136 changes: 45 additions & 91 deletions .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ on:
description: "GitHub App ID for Release creation"
required: false
type: string
skip-version-update:
description: "Whether to skip updating the version in pubspec.yaml"
required: false
type: boolean
default: false
secrets:
KEY_PASSWORD:
required: false
Expand Down Expand Up @@ -113,7 +118,7 @@ jobs:
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0

- name: Update pubspec.yaml version
if: inputs['build-type'] == 'release' && inputs['release-version']
if: ${{ inputs['build-type'] == 'release' && inputs['release-version'] && !inputs['skip-version-update'] }}
run: |
flutter pub global activate pub_version_plus
Comment thread
coderabbitai[bot] marked this conversation as resolved.
pubversion set ${{ inputs['release-version'] }}
Expand Down Expand Up @@ -142,16 +147,16 @@ jobs:
run: |
SHA="${{ github.event.pull_request.head.sha || github.sha }}"
SHORT_SHA="${SHA:0:7}"
VERSION="${{ github.event.inputs['release-version'] }}"
VERSION_NAME="${VERSION:-$(echo "$GITHUB_REF_NAME" | tr / _)}_${SHORT_SHA}"
VERSION_NAME="$(echo "$GITHUB_REF_NAME" | tr / _)_$SHORT_SHA"
RELEASE_VERSION="${{ inputs['release-version'] }}"
VERSION_NAME="$(echo "${RELEASE_VERSION:-$GITHUB_REF_NAME}" | tr / -)_${SHORT_SHA}"
FLAVOR="${{ inputs['build-type'] == 'release' && 'production' || 'staging' }}"
SKIP_SIGN="${{ steps.keystore.outputs.signing_available != 'true' && '-PskipSigning=true' || '' }}"
BUILD_ARGS="--release --flavor $FLAVOR --dart-define=GIT_COMMIT=$SHORT_SHA --obfuscate --split-debug-info=build/app/symbols $SKIP_SIGN"
{
echo "flavor=$FLAVOR"
echo "version_name=$VERSION_NAME"
echo "build_args=--release --flavor $FLAVOR --dart-define=GIT_COMMIT=$SHORT_SHA --obfuscate --split-debug-info=build/app/symbols $SKIP_SIGN"
} >> "$GITHUB_OUTPUT"
echo "build_args=$BUILD_ARGS"
} | tee -a "$GITHUB_OUTPUT"

- name: Build APK
run: flutter build apk ${{ steps.build_options.outputs.build_args }} --split-per-abi
Expand All @@ -160,99 +165,59 @@ jobs:
run: flutter build appbundle ${{ steps.build_options.outputs.build_args }}

- name: Build APK for size analysis
if: inputs['build-type'] == 'size-analysis'
if: ${{ inputs['build-type'] == 'size-analysis' }}
run: flutter build apk ${{ steps.build_options.outputs.build_args }} --analyze-size --target-platform android-arm64

- name: Rename build artifacts
run: |
mkdir -p "$GITHUB_WORKSPACE/build-artifacts"
for apk in build/app/outputs/flutter-apk/*.apk; do
[ -f "$apk" ] || continue
filename=$(basename "$apk")
case "$filename" in
*arm64-v8a*) abi=arm64-v8a ;;
*armeabi-v7a*) abi=armeabi-v7a ;;
*x86_64*) abi=x86_64 ;;
*) abi=universal ;;
esac
mv "$apk" "$GITHUB_WORKSPACE/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_${abi}.apk" || true
done
mv build/app/outputs/bundle/${{ steps.build_options.outputs.flavor }}Release/app-${{ steps.build_options.outputs.flavor }}-release.aab "$GITHUB_WORKSPACE/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}.aab"
mv build/app/symbols "$GITHUB_WORKSPACE/build-artifacts/symbols"

- name: Check arm64 apk
id: check_arm64
run: |
if [ -f "$GITHUB_WORKSPACE/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_arm64-v8a.apk" ]; then
echo "found=true" >> "$GITHUB_OUTPUT"
else
echo "found=false" >> "$GITHUB_OUTPUT"
fi
BUILD_DIR="build/app/outputs"
ARTIFACTS_DIR="$GITHUB_WORKSPACE/build-artifacts"
BASE_NAME="$ARTIFACTS_DIR/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}"
mkdir -p "$ARTIFACTS_DIR"
mv "$BUILD_DIR/flutter-apk/app-arm64-v8a-${{ steps.build_options.outputs.flavor }}-release.apk" "${BASE_NAME}_arm64-v8a.apk" || echo "arm64-v8a APK not found, skipping"
mv "$BUILD_DIR/flutter-apk/app-armeabi-v7a-${{ steps.build_options.outputs.flavor }}-release.apk" "${BASE_NAME}_armeabi-v7a.apk" || echo "armeabi-v7a APK not found, skipping"
mv "$BUILD_DIR/flutter-apk/app-x86_64-${{ steps.build_options.outputs.flavor }}-release.apk" "${BASE_NAME}_x86_64.apk" || echo "x86_64 APK not found, skipping"
mv "$BUILD_DIR/bundle/${{ steps.build_options.outputs.flavor }}Release/app-${{ steps.build_options.outputs.flavor }}-release.aab" "$BASE_NAME.aab" || echo "App bundle not found, skipping"
Comment thread
Friedinger marked this conversation as resolved.

- name: Upload APK arm64-v8a
if: steps.check_arm64.outputs.found == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_arm64-v8a.apk
path: ${{ github.workspace }}/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_arm64-v8a.apk
path: build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_arm64-v8a.apk
archive: false

- name: Check armeabi-v7a apk
id: check_armeabi
run: |
if [ -f "$GITHUB_WORKSPACE/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_armeabi-v7a.apk" ]; then
echo "found=true" >> "$GITHUB_OUTPUT"
else
echo "found=false" >> "$GITHUB_OUTPUT"
fi

- name: Upload APK armeabi-v7a
if: steps.check_armeabi.outputs.found == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_armeabi-v7a.apk
path: ${{ github.workspace }}/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_armeabi-v7a.apk
path: build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_armeabi-v7a.apk
archive: false

- name: Check x86_64 apk
id: check_x86
run: |
if [ -f "$GITHUB_WORKSPACE/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_x86_64.apk" ]; then
echo "found=true" >> "$GITHUB_OUTPUT"
else
echo "found=false" >> "$GITHUB_OUTPUT"
fi

- name: Upload APK x86_64
if: steps.check_x86.outputs.found == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_x86_64.apk
path: ${{ github.workspace }}/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_x86_64.apk
path: build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_x86_64.apk
archive: false

- name: Upload app bundle
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}.aab
path: ${{ github.workspace }}/build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}.aab
path: build-artifacts/${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}.aab
archive: false
Comment thread
Friedinger marked this conversation as resolved.

- name: Upload symbols file
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ inputs['app-name'] }} ${{ steps.build_options.outputs.version_name }} Symbols
path: ${{ github.workspace }}/build-artifacts/symbols
name: ${{ inputs['app-name'] }}_${{ steps.build_options.outputs.version_name }}_symbols
path: ${{ inputs['working-directory'] }}/build/app/symbols

- name: Upload size analysis apk
if: inputs['build-type'] == 'size-analysis'
if: ${{ inputs['build-type'] == 'size-analysis' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: /home/runner/.flutter-devtools/apk-code-size-analysis_01.json
archive: false

- name: Upload pubspec.yaml
if: inputs['build-type'] == 'release' && inputs['release-version']
if: ${{ inputs['build-type'] == 'release' && inputs['release-version'] && !inputs['skip-version-update'] }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: ${{ inputs['working-directory'] }}/pubspec.yaml
Expand All @@ -275,7 +240,7 @@ jobs:
labels: "⚗️ Request Build"

- name: Comment artifact links
if: github.event_name == 'pull_request'
if: ${{ github.event_name == 'pull_request' }}
uses: RubberDuckCrew/artifact2pr@1d2777cac9898de6a6cb16eb32b5c738ea428787 # v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -284,7 +249,7 @@ jobs:
release:
name: Create release
needs: build
if: inputs['build-type'] == 'release' && inputs['release-version']
if: ${{ inputs['build-type'] == 'release' && inputs['release-version'] }}
runs-on: ubuntu-latest

permissions:
Expand Down Expand Up @@ -314,46 +279,40 @@ jobs:
token: ${{ steps.app-token.outputs.token || github.token }}

- name: Download pubspec.yaml
if: ${{ !inputs['skip-version-update'] }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pubspec.yaml
path: ${{ inputs['working-directory'] }}

- name: Commit pubspec.yaml
if: ${{ !inputs['skip-version-update'] }}
uses: suzuki-shunsuke/commit-action@06e3b49d4706498d325d29bd85adc82ecf2f5d8f # v1.0.0
with:
commit_message: "🔖 Release v${{ inputs['release-version'] }} [skip ci]"
files: "${{ inputs['working-directory'] }}/pubspec.yaml"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
github_token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
fail_on_self_push: false

- name: Download APK arm64-v8a artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_arm64-v8a.apk

- name: Download APK armeabi-v7a artifact
- name: Download APK artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_armeabi-v7a.apk

- name: Download APK x86_64 artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_x86_64.apk
path: release-assets
pattern: ${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_*.apk
merge-multiple: true

- name: Download app bundle artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}.aab
path: release-assets

- name: Download symbols artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs['app-name'] }} ${{ needs.build.outputs.version_name }} Symbols

- name: Zip symbols folder
run: |
zip -r "${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_Symbols.zip" ./*.symbols
name: ${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_symbols
path: release-assets
skip-decompress: true

- name: Create GitHub Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
Expand All @@ -362,9 +321,4 @@ jobs:
name: "🔖 v${{ inputs['release-version'] }}"
draft: true
prerelease: false
files: |
${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_arm64-v8a.apk
${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_armeabi-v7a.apk
${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_x86_64.apk
${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}.aab
${{ inputs['app-name'] }}_${{ needs.build.outputs.version_name }}_Symbols.zip
files: release-assets/*
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ A reusable GitHub Actions workflow to **test, build, analyze, and release Flutte

## Inputs

| Name | Description | Required | Default |
| ------------------- | -------------------------------------------------------------- | -------- | ------- |
| `release-version` | Version to release (e.g., `1.2.3`, `v` is added automatically) | No | — |
| `app-name` | Name of the app (used for artifact naming) | No | — |
| `build-type` | Type of build (`test`, `build`, `size-analysis`, `release`) | No | `test` |
| `java-version` | Java version used for Android build | No | `21` |
| `working-directory` | Directory of the Flutter project | No | `.` |
| `bot-app-id` | GitHub App ID used for release creation | No | — |
| Name | Description | Required | Default |
| --------------------- | -------------------------------------------------------------- | -------- | ------- |
| `release-version` | Version to release (e.g., `1.2.3`, `v` is added automatically) | No | — |
| `app-name` | Name of the app (used for artifact naming) | No | — |
| `build-type` | Type of build (`test`, `build`, `size-analysis`, `release`) | No | `test` |
| `java-version` | Java version used for Android build | No | `21` |
| `working-directory` | Directory of the Flutter project | No | `.` |
| `bot-app-id` | GitHub App ID used for release creation | No | — |
| `skip-version-update` | Whether to skip updating the version in pubspec.yaml | No | `false` |

## Secrets

Expand Down
Loading