Skip to content

Commit 5471b2b

Browse files
committed
Fix automation
1 parent 518cbb0 commit 5471b2b

File tree

1 file changed

+69
-19
lines changed

1 file changed

+69
-19
lines changed

.github/workflows/build-demo.yaml

Lines changed: 69 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,74 @@
11
name: Openvpn_flutter
2-
32
on: push
4-
3+
54
jobs:
65
build:
7-
name: Build APK
8-
runs-on: macos-latest
6+
name: Build Flutter Artifacts
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
target: [documentation, apks]
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Set up JDK 21
16+
if: matrix.target != 'documentation'
17+
uses: actions/setup-java@v2
18+
with:
19+
distribution: 'adopt'
20+
java-version: '21.x'
21+
22+
- name: Install Flutter SDK
23+
uses: subosito/flutter-action@v2
24+
with:
25+
channel: 'stable'
26+
27+
- name: Flutter pub get
28+
run: flutter pub get
29+
30+
- name: Build Documentation
31+
if: matrix.target == 'documentation'
32+
run: |
33+
flutter pub global activate dartdoc
34+
flutter pub global run dartdoc
35+
36+
- name: Build APKs (Split by ABI)
37+
if: matrix.target == 'apks'
38+
run: cd example && flutter build apk --release --split-per-abi
39+
40+
- name: Upload artifacts
41+
if: matrix.target == 'apks' || matrix.target == 'appbundle'
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: publish-artifacts-${{ matrix.target }}
45+
path: |
46+
build/app/outputs/flutter-apk/*.apk
47+
if-no-files-found: ignore
48+
overwrite: true
49+
50+
publish:
51+
name: Publish the binaries
52+
needs: build
53+
runs-on: ubuntu-latest
954
steps:
10-
- uses: actions/checkout@v1
11-
- uses: actions/setup-java@v1
12-
with:
13-
java-version: '12.x'
14-
- uses: subosito/flutter-action@v1
15-
with:
16-
flutter-version: '2.5.3'
17-
- run: flutter pub get
18-
- run: cd example && flutter build apk --release --split-per-abi
19-
- name: Release apks
20-
uses: ncipollo/release-action@v1
21-
with:
22-
artifacts: "example/build/app/outputs/apk/release/*.apk"
23-
token: ${{ secrets.GITHUB_TOKEN }}
24-
tag: v1.0.${{github.run_number}}
55+
- uses: actions/checkout@v2
56+
57+
- name: Get project version
58+
id: project_version
59+
uses: its404/[email protected]
60+
61+
- name: Download apks
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: publish-artifacts-apks
65+
path: build/app/outputs/flutter-apk
66+
67+
- name: Release Binary
68+
uses: ncipollo/release-action@v1
69+
with:
70+
artifacts: "build/app/outputs/bundle/release/*.aab, build/app/outputs/flutter-apk/*.apk"
71+
token: ${{ secrets.GITHUB_TOKEN }}
72+
tag: v${{ steps.project_version.outputs.version_number }}+${{steps.project_version.outputs.build_number}}-${{github.run_number}}
73+
name: "Release ${{ steps.project_version.outputs.version_number }}+${{steps.project_version.outputs.build_number}}"
74+
generateReleaseNotes: true

0 commit comments

Comments
 (0)