Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit ff3a67d

Browse files
authoredSep 23, 2022
ci: updated release workflow (#84)
* ci: updated release workflow with windows, macos and ios * feat(ci): trigger workflow if pubspec.yaml is changed * fix(ci): move ios builds release before macos ones * style: proper publish workflows ids
1 parent 495d07f commit ff3a67d

File tree

3 files changed

+178
-87
lines changed

3 files changed

+178
-87
lines changed
 

‎.github/workflows/microsoft_store_publish.yaml

-65
This file was deleted.

‎.github/workflows/release.yaml

+175-20
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,32 @@ on:
44
push:
55
branches:
66
- release
7+
paths:
8+
- "pubspec.yaml"
79

810
jobs:
911
changelog:
1012
name: 📃 Create changelog
1113
runs-on: ubuntu-latest
12-
timeout-minutes: 5
14+
timeout-minutes: 3
1315
outputs:
1416
changelog: ${{ steps.build_changelog.outputs.changelog }}
1517
steps:
1618
- name: Checks-out repository
1719
uses: actions/checkout@v3
1820

19-
- name: Build Changelog
21+
- name: Create changelog
2022
id: build_changelog
2123
uses: mikepenz/release-changelog-builder-action@v3.3.1
2224
env:
2325
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2426
with:
2527
configuration: ".github/workflows/actions_settings/changelog_config.json"
2628

27-
build:
28-
name: 🏗️ Build Artifacts and Release
29+
build-android-linux:
30+
name: 🤖 Build Android and Linux apps
2931
runs-on: ubuntu-latest
30-
timeout-minutes: 15
32+
timeout-minutes: 25
3133
steps:
3234
- name: Checks-out repository
3335
uses: actions/checkout@v3
@@ -46,52 +48,184 @@ jobs:
4648
uses: actions/setup-java@v3
4749
with:
4850
distribution: "zulu"
49-
java-version: "17"
51+
java-version: "18"
52+
53+
- name: Update Linux dependencies
54+
run: sudo apt-get update -y
55+
56+
- name: Install new Linux dependencies
57+
run: sudo apt-get --assume-yes --fix-missing install libgles2-mesa-dev clang cmake unzip curl ninja-build pkg-config libgtk-3-dev liblzma-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsecret-1-dev libjsoncpp-dev libsecret-1-0 libjsoncpp1
5058

5159
- name: Install Flutter
5260
uses: subosito/flutter-action@v2.7.1
5361
with:
5462
cache: true
5563

56-
- name: Decode android/key.properties
64+
- name: Enable Linux
65+
run: flutter config --enable-linux-desktop
66+
67+
- name: Install app dependencies
68+
run: flutter pub get
69+
70+
- name: Build Linux app
71+
run: flutter build linux --release
72+
73+
- name: Compress Linux app
74+
uses: papeloto/action-zip@v1
75+
with:
76+
files: ./build/linux/x64/release/bundle/
77+
dest: ./colors-ai-linux.zip
78+
79+
- name: Decode key.properties
5780
run: echo "${{ secrets.KEY_PROPERTIES_BASE64 }}" | base64 --decode > android/key.properties
5881

59-
- name: Decode android/app/key.jks
82+
- name: Decode key.jks
6083
run: echo "${{ secrets.KEYSTORE_JKS_BASE64 }}" | base64 --decode > android/app/key.jks
6184

62-
- name: Pub Get Packages
63-
run: flutter pub get
64-
6585
- name: Build Android app
6686
run: flutter build appbundle --release && flutter build apk --release
6787

88+
- name: Rename APK
89+
run: mv ./build/app/outputs/flutter-apk/app-release.apk ./build/app/outputs/flutter-apk/colors-ai-android.apk
90+
6891
- name: Create Github Release
6992
uses: ncipollo/release-action@v1
7093
with:
71-
artifacts: "build/app/outputs/bundle/release/app-release.aab,build/app/outputs/flutter-apk/app-release.apk"
94+
artifacts: "build/app/outputs/flutter-apk/colors-ai-android.apk,colors-ai-linux.zip"
95+
body: "${{ github.event.head_commit.message }}"
7296
token: ${{ secrets.GH_TOKEN }}
7397
tag: "${{env.RELEASE_TAG}}"
74-
body: "${{ github.event.head_commit.message }}"
98+
allowUpdates: true
7599

76100
- name: Save AAB to Artifacts
77101
uses: actions/upload-artifact@v3
78102
with:
79103
name: APPBUNDLE
80104
path: build/app/outputs/bundle/release/app-release.aab
81105

82-
- name: Save APK to Artifacts
106+
build-windows:
107+
runs-on: windows-latest
108+
needs: build-android-linux
109+
name: 🖥️ Build Windows app
110+
timeout-minutes: 15
111+
steps:
112+
- name: Checks-out repository
113+
uses: actions/checkout@v3
114+
with:
115+
fetch-depth: 0
116+
117+
- name: Get latest release tag
118+
id: previoustag
119+
uses: WyriHaximus/github-action-get-previous-tag@v1
120+
121+
- name: Install Flutter
122+
uses: subosito/flutter-action@v2.7.1
123+
with:
124+
cache: true
125+
126+
- name: Enable Windows
127+
run: flutter config --enable-windows-desktop
128+
129+
- name: Install app dependencies
130+
run: flutter pub get
131+
132+
- name: Build Windows app
133+
run: flutter build windows --release
134+
135+
- name: Create MSIX package
136+
run: flutter pub run msix:create
137+
138+
- name: Save MSIX to Artifacts
83139
uses: actions/upload-artifact@v3
84140
with:
85-
name: APK
86-
path: build/app/outputs/flutter-apk/app-release.apk
141+
name: windows-release-build
142+
path: build\windows\runner\Release\colors_ai.msix
143+
retention-days: 1
144+
145+
- name: Copy VC redistributables
146+
run: |
147+
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') .
148+
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') .
149+
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140_1.dll') .
150+
working-directory: ./build/windows/runner/Release
87151

88-
release_google_play:
89-
name: 🏭 Release Artifacts to Google Play Store
90-
needs: [build, changelog]
152+
- name: Compress Windows app
153+
uses: papeloto/action-zip@v1
154+
with:
155+
files: ./build/windows/runner/Release/
156+
dest: ./colors-ai-windows.zip
157+
158+
- uses: djnicholson/release-action@v2.11
159+
with:
160+
token: ${{ secrets.GH_TOKEN }}
161+
tag-name: "${{ steps.previoustag.outputs.tag }}"
162+
asset-name: "colors-ai-windows.zip"
163+
file: "colors-ai-windows.zip"
164+
165+
build-apple:
166+
name: 🍏 Build macOS and iOS apps
167+
needs: build-android-linux
168+
runs-on: macos-latest
169+
steps:
170+
- name: Checks-out repository
171+
uses: actions/checkout@v3
172+
with:
173+
fetch-depth: 0
174+
175+
- name: Get latest release tag
176+
id: previoustag
177+
uses: WyriHaximus/github-action-get-previous-tag@v1
178+
179+
- name: Install Flutter
180+
uses: subosito/flutter-action@v2.7.1
181+
with:
182+
cache: true
183+
184+
- name: Enable macOS
185+
run: flutter config --enable-macos-desktop
186+
187+
- name: Install app dependencies
188+
run: flutter pub get
189+
190+
- name: Build iOS app
191+
run: flutter build ios --release --no-codesign
192+
193+
- name: Compress iOS app
194+
run: |
195+
mkdir -p colors-ai
196+
mv ./build/ios/iphoneos/Runner.app colors-ai
197+
zip -r -y colors-ai.zip colors-ai/Runner.app
198+
mv colors-ai.zip colors-ai-ios.ipa
199+
200+
- uses: djnicholson/release-action@v2.11
201+
with:
202+
token: ${{ secrets.GH_TOKEN }}
203+
tag-name: "${{ steps.previoustag.outputs.tag }}"
204+
asset-name: "colors-ai-ios.ipa"
205+
file: "colors-ai-ios.ipa"
206+
207+
- name: Build macOS app
208+
run: flutter build macos
209+
210+
- name: Compress macOS app
211+
run: zip -r colors-ai-macos.zip build/macos/Build/Products/Debug
212+
213+
- uses: djnicholson/release-action@v2.11
214+
with:
215+
token: ${{ secrets.GH_TOKEN }}
216+
tag-name: "${{ steps.previoustag.outputs.tag }}"
217+
asset-name: "colors-ai-macos.zip"
218+
file: "colors-ai-macos.zip"
219+
220+
publish-on-google-play:
221+
name: 🏬 Publish app in Google Play Store
222+
needs: [build-android-linux, changelog]
91223
runs-on: ubuntu-latest
92224
timeout-minutes: 10
93225
steps:
94-
- uses: actions/checkout@v3
226+
- name: Checks-out repository
227+
uses: actions/checkout@v3
228+
95229
- name: Get AAB from Artifacts
96230
uses: actions/download-artifact@v3
97231
with:
@@ -112,3 +246,24 @@ jobs:
112246
whatsNewDirectory: whatsnew
113247
track: production
114248
status: draft
249+
250+
publish-on-windows-store:
251+
needs: build-windows
252+
runs-on: ubuntu-latest
253+
name: 🏪 Publish app in Microsoft Store
254+
timeout-minutes: 15
255+
steps:
256+
- uses: actions/download-artifact@v3
257+
name: Download Release
258+
with:
259+
name: windows-release-build
260+
path: "${{ github.workspace }}/release"
261+
262+
- uses: isaacrlevin/windows-store-action@1.0
263+
name: Publish to Store
264+
with:
265+
tenant-id: ${{ secrets.AZURE_AD_TENANT_ID }}
266+
client-id: ${{ secrets.AZURE_AD_APPLICATION_CLIENT_ID }}
267+
client-secret: ${{ secrets.AZURE_AD_APPLICATION_SECRET }}
268+
app-id: ${{ secrets.WINDOWS_STORE_APP_ID }}
269+
package-path: "${{ github.workspace }}/release"

‎macos/Runner.xcodeproj/project.pbxproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
@@ -257,6 +257,7 @@
257257
};
258258
33CC111E2044C6BF0003C045 /* ShellScript */ = {
259259
isa = PBXShellScriptBuildPhase;
260+
alwaysOutOfDate = 1;
260261
buildActionMask = 2147483647;
261262
files = (
262263
);
@@ -273,7 +274,7 @@
273274
);
274275
runOnlyForDeploymentPostprocessing = 0;
275276
shellPath = /bin/sh;
276-
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
277+
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire\n";
277278
};
278279
587F50D40D07B70EA2D9ACB7 /* [CP] Check Pods Manifest.lock */ = {
279280
isa = PBXShellScriptBuildPhase;

0 commit comments

Comments
 (0)
This repository has been archived.