Skip to content

Commit f824e1b

Browse files
committed
Optimized github actions
1 parent 805b56e commit f824e1b

File tree

2 files changed

+210
-90
lines changed

2 files changed

+210
-90
lines changed

.github/workflows/android.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
on:
2+
push:
3+
tags:
4+
- "*"
5+
6+
name: Android build and release
7+
jobs:
8+
build:
9+
name: Android build
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
steps:
16+
- name: Cache Gradle files
17+
uses: actions/cache@v3
18+
with:
19+
path: |
20+
~/.gradle/caches
21+
~/.gradle/wrapper
22+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
23+
restore-keys: |
24+
${{ runner.os }}-gradle-
25+
26+
- name: Set up Flutter
27+
uses: subosito/flutter-action@v2
28+
with:
29+
flutter-version: "3.22.2"
30+
channel: "stable"
31+
cache: true
32+
33+
- name: Cache pub dependencies
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
${{ env.PUB_CACHE }}
38+
.dart_tool
39+
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-pub-
42+
43+
- uses: actions/setup-java@v4
44+
with:
45+
java-version: "17"
46+
distribution: "oracle"
47+
48+
- uses: actions/checkout@v4
49+
with:
50+
path: "app"
51+
52+
- uses: actions/checkout@v4
53+
with:
54+
repository: "hmziqrs/keys-n-stuff"
55+
path: "app/.keys-n-stuff"
56+
token: ${{ secrets.TOKEN }}
57+
58+
- name: Execute Keys n Stuff
59+
run: |
60+
cd app
61+
dart ./scripts/keys-n-stuff.dart
62+
63+
- run: |
64+
cd app
65+
flutter pub get
66+
dart scripts/version_sync.dart
67+
flutter build apk -t lib/main.firebase.dart --release
68+
flutter build appbundle -t lib/main.firebase.dart --release
69+
70+
- name: Create Android release
71+
uses: ncipollo/release-action@v1
72+
with:
73+
artifacts: |
74+
app/build/app/outputs/apk/release/app-release.apk
75+
app/build/app/outputs/bundle/release/app-release.aab
76+
token: ${{ secrets.TOKEN }}
77+
allowUpdates: true
78+
79+
- uses: actions/upload-artifact@v4
80+
with:
81+
name: "app-release.aab"
82+
path: "app/build/app/outputs/bundle/release/app-release.aab"
83+
- uses: actions/upload-artifact@v4
84+
with:
85+
name: "app-release.apk"
86+
path: "app/build/app/outputs/apk/release/app-release.apk"
87+
88+
release:
89+
name: Android release
90+
needs: android
91+
runs-on: ubuntu-latest
92+
permissions:
93+
contents: read
94+
pages: write
95+
id-token: write
96+
steps:
97+
- uses: actions/checkout@v4
98+
with:
99+
repository: "hmziqrs/keys-n-stuff"
100+
path: "keys"
101+
token: ${{ secrets.TOKEN }}
102+
103+
- uses: actions/download-artifact@v4
104+
with:
105+
name: app-release.aab
106+
path: artifacts
107+
- run: ls -lah
108+
- run: ls -lah keys/
109+
- run: ls -lah keys/fuid
110+
- run: ls -lah artifacts
111+
- run: ls -lah artifacts/app-release.aab
112+
- name: Upload app bundle to Google Play
113+
uses: r0adkll/upload-google-play@v1
114+
with:
115+
serviceAccountJson: "keys/fuid/service-account.json"
116+
packageName: "com.onemdev.flutter_ui_challenges"
117+
releaseFiles: "artifacts/*.aab"
118+
track: "beta"
119+
inAppUpdatePriority: 3
120+
status: completed

.github/workflows/main.yml

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -99,96 +99,96 @@ jobs:
9999
id: deployment
100100
uses: actions/deploy-pages@v4
101101

102-
android:
103-
name: Android
104-
runs-on: ubuntu-latest
105-
permissions:
106-
contents: read
107-
pages: write
108-
id-token: write
109-
steps:
110-
- name: Set up Flutter
111-
uses: subosito/flutter-action@v2
112-
with:
113-
flutter-version: "3.22.2"
114-
channel: "stable"
115-
116-
- uses: actions/setup-java@v4
117-
with:
118-
java-version: "17"
119-
distribution: "oracle"
120-
121-
- uses: actions/checkout@v4
122-
with:
123-
path: "app"
124-
125-
- uses: actions/checkout@v4
126-
with:
127-
repository: "hmziqrs/keys-n-stuff"
128-
path: "app/.keys-n-stuff"
129-
token: ${{ secrets.TOKEN }}
130-
131-
- name: Execute Keys n Stuff
132-
run: |
133-
cd app
134-
dart ./scripts/keys-n-stuff.dart
135-
136-
- run: |
137-
cd app
138-
flutter pub get
139-
dart scripts/version_sync.dart
140-
flutter build apk -t lib/main.firebase.dart --release
141-
flutter build appbundle -t lib/main.firebase.dart --release
142-
143-
- name: Create Android Release
144-
uses: ncipollo/release-action@v1
145-
with:
146-
artifacts: "app/build/app/outputs/apk/release/app-release.apk,app/build/app/outputs/bundle/release/app-release.aab"
147-
token: ${{ secrets.TOKEN }}
148-
allowUpdates: true
149-
150-
- uses: actions/upload-artifact@v4
151-
with:
152-
name: "app-release.aab"
153-
path: "app/build/app/outputs/bundle/release/app-release.aab"
154-
- uses: actions/upload-artifact@v4
155-
with:
156-
name: "app-release.apk"
157-
path: "app/build/app/outputs/apk/release/app-release.apk"
158-
159-
playstore:
160-
name: Playstore Release
161-
needs: android
162-
runs-on: ubuntu-latest
163-
permissions:
164-
contents: read
165-
pages: write
166-
id-token: write
167-
steps:
168-
- uses: actions/checkout@v4
169-
with:
170-
repository: "hmziqrs/keys-n-stuff"
171-
path: "keys"
172-
token: ${{ secrets.TOKEN }}
173-
174-
- uses: actions/download-artifact@v4
175-
with:
176-
name: app-release.aab
177-
path: artifacts
178-
- run: ls -lah
179-
- run: ls -lah keys/
180-
- run: ls -lah keys/fuid
181-
- run: ls -lah artifacts
182-
- run: ls -lah artifacts/app-release.aab
183-
- name: Upload app bundle to Google Play
184-
uses: r0adkll/upload-google-play@v1
185-
with:
186-
serviceAccountJson: "keys/fuid/service-account.json"
187-
packageName: "com.onemdev.flutter_ui_challenges"
188-
releaseFile: "artifacts/*.aab"
189-
track: "beta"
190-
inAppUpdatePriority: 3
191-
status: completed
102+
# android:
103+
# name: Android
104+
# runs-on: ubuntu-latest
105+
# permissions:
106+
# contents: read
107+
# pages: write
108+
# id-token: write
109+
# steps:
110+
# - name: Set up Flutter
111+
# uses: subosito/flutter-action@v2
112+
# with:
113+
# flutter-version: "3.22.2"
114+
# channel: "stable"
115+
116+
# - uses: actions/setup-java@v4
117+
# with:
118+
# java-version: "17"
119+
# distribution: "oracle"
120+
121+
# - uses: actions/checkout@v4
122+
# with:
123+
# path: "app"
124+
125+
# - uses: actions/checkout@v4
126+
# with:
127+
# repository: "hmziqrs/keys-n-stuff"
128+
# path: "app/.keys-n-stuff"
129+
# token: ${{ secrets.TOKEN }}
130+
131+
# - name: Execute Keys n Stuff
132+
# run: |
133+
# cd app
134+
# dart ./scripts/keys-n-stuff.dart
135+
136+
# - run: |
137+
# cd app
138+
# flutter pub get
139+
# dart scripts/version_sync.dart
140+
# flutter build apk -t lib/main.firebase.dart --release
141+
# flutter build appbundle -t lib/main.firebase.dart --release
142+
143+
# - name: Create Android Release
144+
# uses: ncipollo/release-action@v1
145+
# with:
146+
# artifacts: "app/build/app/outputs/apk/release/app-release.apk,app/build/app/outputs/bundle/release/app-release.aab"
147+
# token: ${{ secrets.TOKEN }}
148+
# allowUpdates: true
149+
150+
# - uses: actions/upload-artifact@v4
151+
# with:
152+
# name: "app-release.aab"
153+
# path: "app/build/app/outputs/bundle/release/app-release.aab"
154+
# - uses: actions/upload-artifact@v4
155+
# with:
156+
# name: "app-release.apk"
157+
# path: "app/build/app/outputs/apk/release/app-release.apk"
158+
159+
# playstore:
160+
# name: Playstore Release
161+
# needs: android
162+
# runs-on: ubuntu-latest
163+
# permissions:
164+
# contents: read
165+
# pages: write
166+
# id-token: write
167+
# steps:
168+
# - uses: actions/checkout@v4
169+
# with:
170+
# repository: "hmziqrs/keys-n-stuff"
171+
# path: "keys"
172+
# token: ${{ secrets.TOKEN }}
173+
174+
# - uses: actions/download-artifact@v4
175+
# with:
176+
# name: app-release.aab
177+
# path: artifacts
178+
# - run: ls -lah
179+
# - run: ls -lah keys/
180+
# - run: ls -lah keys/fuid
181+
# - run: ls -lah artifacts
182+
# - run: ls -lah artifacts/app-release.aab
183+
# - name: Upload app bundle to Google Play
184+
# uses: r0adkll/upload-google-play@v1
185+
# with:
186+
# serviceAccountJson: "keys/fuid/service-account.json"
187+
# packageName: "com.onemdev.flutter_ui_challenges"
188+
# releaseFile: "artifacts/*.aab"
189+
# track: "beta"
190+
# inAppUpdatePriority: 3
191+
# status: completed
192192

193193
macos:
194194
name: MacOS

0 commit comments

Comments
 (0)