Skip to content

Commit 02371c4

Browse files
ci(release): trigger APK build and GitHub release on version tags
- Fires on any tag matching v* pushed to the repo - Builds release APK, renames it koshika-<version>.apk - Creates GitHub release with auto-generated notes and APK attached - Tags with a hyphen (e.g. v0.2.0-facelift) are marked as pre-release
1 parent 474cea5 commit 02371c4

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
name: Release Branch Checks
1+
name: Release
22

33
on:
44
push:
5-
branches:
6-
- "release/**"
7-
pull_request:
8-
branches:
9-
- "release/**"
5+
tags:
6+
- 'v*'
107

118
jobs:
12-
android-build:
9+
build-and-release:
10+
name: Build APK and publish release
1311
runs-on: ubuntu-latest
1412

1513
steps:
@@ -20,7 +18,7 @@ jobs:
2018
uses: actions/setup-java@v4
2119
with:
2220
distribution: temurin
23-
java-version: "17"
21+
java-version: '17'
2422

2523
- name: Set up Flutter
2624
uses: subosito/flutter-action@v2
@@ -31,20 +29,22 @@ jobs:
3129
- name: Install dependencies
3230
run: flutter pub get
3331

34-
- name: Generate code
32+
- name: Generate ObjectBox bindings
3533
run: dart run build_runner build --delete-conflicting-outputs
3634

37-
- name: Analyze
38-
run: flutter analyze
39-
40-
- name: Run tests
41-
run: flutter test
42-
43-
- name: Build Android APK
35+
- name: Build release APK
4436
run: flutter build apk --release
4537

46-
- name: Upload APK artifact
47-
uses: actions/upload-artifact@v4
38+
- name: Rename APK with version
39+
run: |
40+
mv build/app/outputs/flutter-apk/app-release.apk \
41+
build/app/outputs/flutter-apk/koshika-${{ github.ref_name }}.apk
42+
43+
- name: Create GitHub Release
44+
uses: softprops/action-gh-release@v2
4845
with:
49-
name: koshika-release-apk
50-
path: build/app/outputs/flutter-apk/app-release.apk
46+
name: ${{ github.ref_name }}
47+
files: build/app/outputs/flutter-apk/koshika-${{ github.ref_name }}.apk
48+
generate_release_notes: true
49+
draft: false
50+
prerelease: ${{ contains(github.ref_name, '-') }}

0 commit comments

Comments
 (0)