Skip to content

Commit 7bb5e7c

Browse files
committed
fix: Add Github actions for auto-release package creation
1 parent 4677a44 commit 7bb5e7c

1 file changed

Lines changed: 118 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-macos:
13+
runs-on: macos-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: subosito/flutter-action@v2
18+
with:
19+
flutter-version: '3.41.2'
20+
channel: stable
21+
cache: true
22+
23+
- name: Install dependencies
24+
run: flutter pub get
25+
26+
- name: Build macOS
27+
run: flutter build macos --release
28+
29+
- name: Package macOS app
30+
run: |
31+
cd build/macos/Build/Products/Release
32+
zip -r "$GITHUB_WORKSPACE/linkdqueue-macos.zip" linkdqueue.app
33+
34+
- uses: actions/upload-artifact@v4
35+
with:
36+
name: macos
37+
path: linkdqueue-macos.zip
38+
39+
build-linux:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Install Linux build dependencies
45+
run: |
46+
sudo apt-get update -y
47+
sudo apt-get install -y \
48+
clang cmake ninja-build pkg-config \
49+
libgtk-3-dev liblzma-dev libstdc++-12-dev \
50+
libsecret-1-dev libjsoncpp-dev
51+
52+
- uses: subosito/flutter-action@v2
53+
with:
54+
flutter-version: '3.41.2'
55+
channel: stable
56+
cache: true
57+
58+
- name: Install dependencies
59+
run: flutter pub get
60+
61+
- name: Build Linux
62+
run: flutter build linux --release
63+
64+
- name: Package Linux app
65+
run: |
66+
tar -czvf linkdqueue-linux.tar.gz \
67+
-C build/linux/x64/release/bundle .
68+
69+
- uses: actions/upload-artifact@v4
70+
with:
71+
name: linux
72+
path: linkdqueue-linux.tar.gz
73+
74+
build-windows:
75+
runs-on: windows-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
79+
- uses: subosito/flutter-action@v2
80+
with:
81+
flutter-version: '3.41.2'
82+
channel: stable
83+
cache: true
84+
85+
- name: Install dependencies
86+
run: flutter pub get
87+
88+
- name: Build Windows
89+
run: flutter build windows --release
90+
91+
- name: Package Windows app
92+
shell: pwsh
93+
run: |
94+
Compress-Archive `
95+
-Path build/windows/x64/runner/Release/* `
96+
-DestinationPath linkdqueue-windows.zip
97+
98+
- uses: actions/upload-artifact@v4
99+
with:
100+
name: windows
101+
path: linkdqueue-windows.zip
102+
103+
release:
104+
needs: [build-macos, build-linux, build-windows]
105+
runs-on: ubuntu-latest
106+
steps:
107+
- uses: actions/download-artifact@v4
108+
with:
109+
path: artifacts
110+
111+
- name: Create GitHub Release
112+
uses: softprops/action-gh-release@v2
113+
with:
114+
files: |
115+
artifacts/macos/linkdqueue-macos.zip
116+
artifacts/linux/linkdqueue-linux.tar.gz
117+
artifacts/windows/linkdqueue-windows.zip
118+
generate_release_notes: true

0 commit comments

Comments
 (0)