Skip to content

Commit fd07a87

Browse files
committed
feat: integrate github action for windows x86_64 release
1 parent e037e11 commit fd07a87

File tree

4 files changed

+138
-1
lines changed

4 files changed

+138
-1
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,54 @@ jobs:
129129
asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_X86_ZIP_NAME }}
130130
asset_name: ${{ env.MACOS_X86_ZIP_NAME }}
131131
asset_content_type: application/octet-stream
132+
133+
build-windows-x86_64:
134+
runs-on: windows-latest
135+
needs: create-release
136+
env:
137+
WINDOWS_APP_RELEASE_PATH: frontend\app_flowy\product\${{ github.ref_name }}\windows
138+
WINDOWS_ZIP_NAME: AppFlowy-windows-x86_64.zip
139+
steps:
140+
- name: Checkout
141+
uses: actions/checkout@v3
142+
143+
- name: Setup environment - Rust and Cargo
144+
uses: actions-rs/toolchain@v1
145+
with:
146+
toolchain: 'stable-2022-01-20'
147+
148+
- name: Setup environment - Flutter
149+
uses: subosito/flutter-action@v2
150+
with:
151+
channel: 'stable'
152+
flutter-version: '3.0.5'
153+
154+
- name: Pre build
155+
working-directory: frontend
156+
run: |
157+
vcpkg integrate install
158+
cargo install --force cargo-make
159+
cargo install --force duckscript_cli
160+
cargo make flowy_dev
161+
162+
- name: Build Windows app
163+
working-directory: frontend
164+
run: |
165+
flutter config --enable-windows-desktop
166+
cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-windows-x86 appflowy
167+
168+
- uses: vimtor/action-zip@v1
169+
with:
170+
files: ${{ env.WINDOWS_APP_RELEASE_PATH }}\
171+
dest: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}
172+
173+
- name: Upload Release Asset
174+
id: upload-release-asset
175+
uses: actions/upload-release-asset@v1
176+
env:
177+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178+
with:
179+
upload_url: ${{ needs.create-release.outputs.upload_url }}
180+
asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}
181+
asset_name: ${{ env.WINDOWS_ZIP_NAME }}
182+
asset_content_type: application/octet-stream
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
env:
12+
RELEASE_NOTES_PATH: /tmp/release_notes
13+
outputs:
14+
upload_url: ${{ steps.create_release.outputs.upload_url }}
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Build release notes
20+
run: |
21+
touch ${{ env.RELEASE_NOTES_PATH }}
22+
cat CHANGELOG.md | sed -e '/./{H;$!d;}' -e "x;/##\ Version\ ${{ github.ref_name }}/"'!d;' >> ${{ env.RELEASE_NOTES_PATH }}
23+
24+
- name: Create release
25+
id: create_release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
tag_name: ${{ github.ref }}
31+
release_name: Release ${{ github.ref }}
32+
body_path: ${{ env.RELEASE_NOTES_PATH }}
33+
34+
build-windows:
35+
runs-on: windows-latest
36+
needs: create-release
37+
env:
38+
WINDOWS_APP_RELEASE_PATH: frontend\app_flowy\product\${{ github.ref_name }}\windows
39+
WINDOWS_ZIP_NAME: AppFlowy-windows-x86.zip
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v3
43+
44+
- name: Setup environment - Rust and Cargo
45+
uses: actions-rs/toolchain@v1
46+
with:
47+
toolchain: 'stable-2022-01-20'
48+
49+
- name: Setup environment - Flutter
50+
uses: subosito/flutter-action@v2
51+
with:
52+
channel: 'stable'
53+
flutter-version: '3.0.5'
54+
55+
- name: Pre build
56+
working-directory: frontend
57+
run: |
58+
vcpkg integrate install
59+
cargo install --force cargo-make
60+
cargo install --force duckscript_cli
61+
cargo make flowy_dev
62+
63+
- name: Build Windows app
64+
working-directory: frontend
65+
run: |
66+
flutter config --enable-windows-desktop
67+
cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-windows-x86 appflowy
68+
69+
- uses: vimtor/action-zip@v1
70+
with:
71+
files: ${{ env.WINDOWS_APP_RELEASE_PATH }}\
72+
dest: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}
73+
74+
- name: Upload Release Asset
75+
id: upload-release-asset
76+
uses: actions/upload-release-asset@v1
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
with:
80+
upload_url: ${{ needs.create-release.outputs.upload_url }}
81+
asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}
82+
asset_name: ${{ env.WINDOWS_ZIP_NAME }}
83+
asset_content_type: application/octet-stream

frontend/scripts/makefile/flutter.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ script = [
186186
"""
187187
cd ./app_flowy/
188188
exec cmd.exe /c flutter clean
189-
exec cmd.exe /c flutter pub get
189+
exec cmd.exe /c flutter packages pub get
190190
exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
191191
exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs
192192
"""

frontend/scripts/makefile/protobuf.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ end
2929
ret = which protoc-gen-dart
3030
if is_empty ${ret}
3131
exec cmd.exe /c dart pub global activate protoc_plugin
32+
end
33+
ret = which protoc-gen-dart
34+
if is_empty ${ret}
3235
home_dir = get_home_dir
3336
echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var
3437
exit -1

0 commit comments

Comments
 (0)