-
Notifications
You must be signed in to change notification settings - Fork 1
189 lines (156 loc) · 5.16 KB
/
Copy pathrelease.yml
File metadata and controls
189 lines (156 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- name: Install dependencies
run: flutter pub get
- name: Build Linux
run: flutter build linux --release
- name: Package Linux artifact
run: tar -czf codewalk-linux-x64.tar.gz -C build/linux/x64/release/bundle .
- name: Upload Linux artifact
uses: actions/upload-artifact@v4
with:
name: codewalk-linux
path: codewalk-linux-x64.tar.gz
build-windows:
runs-on: windows-latest
timeout-minutes: 35
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build Windows
run: flutter build windows --release
- name: Package Windows artifact
shell: pwsh
run: Compress-Archive -Path "build/windows/x64/runner/Release/*" -DestinationPath "codewalk-windows-x64.zip"
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: codewalk-windows
path: codewalk-windows-x64.zip
build-macos:
runs-on: macos-latest
timeout-minutes: 35
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build macOS (universal)
run: flutter build macos --release --universal
- name: Package macOS artifacts
run: |
tar -czf codewalk-macos-arm64.tar.gz -C build/macos/Build/Products/Release codewalk.app
cp codewalk-macos-arm64.tar.gz codewalk-macos-x64.tar.gz
- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: codewalk-macos
path: |
codewalk-macos-arm64.tar.gz
codewalk-macos-x64.tar.gz
build-android:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Setup Android signing
env:
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
run: |
if [ -n "$KEYSTORE_BASE64" ]; then
echo "$KEYSTORE_BASE64" | base64 --decode > android/app/upload-keystore.jks
{
echo "storePassword=$STORE_PASSWORD"
echo "keyPassword=$KEY_PASSWORD"
echo "keyAlias=$KEY_ALIAS"
echo "storeFile=upload-keystore.jks"
} > android/key.properties
else
echo "Signing secrets not configured. Building unsigned artifact."
fi
- name: Install dependencies
run: flutter pub get
- name: Build APK (arm64)
run: flutter build apk --release --target-platform android-arm64
- name: Rename APK
run: mv build/app/outputs/flutter-apk/app-release.apk codewalk-android-arm64.apk
- name: Upload Android artifact
uses: actions/upload-artifact@v4
with:
name: codewalk-android
path: codewalk-android-arm64.apk
create-release:
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-macos, build-android]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: List artifacts
run: find artifacts/ -type f
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/codewalk-linux/codewalk-linux-x64.tar.gz
artifacts/codewalk-windows/codewalk-windows-x64.zip
artifacts/codewalk-macos/codewalk-macos-arm64.tar.gz
artifacts/codewalk-macos/codewalk-macos-x64.tar.gz
artifacts/codewalk-android/codewalk-android-arm64.apk
generate_release_notes: true
draft: false
prerelease: false