Skip to content

Commit 24c4a82

Browse files
committed
(feature) Added new pipeline
1 parent 618e9de commit 24c4a82

File tree

1 file changed

+190
-0
lines changed

1 file changed

+190
-0
lines changed

.github/workflows/deploy_commit.yml

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
name: Release Branch or Commit
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: 'Branch or commit SHA to release'
8+
required: true
9+
default: 'main'
10+
version:
11+
description: 'Version to release'
12+
required: true
13+
14+
jobs:
15+
build-and-release-linux:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.inputs.ref }}
21+
- uses: subosito/flutter-action@v2
22+
with:
23+
channel: 'stable'
24+
flutter-version: '3.19.5'
25+
- uses: actions/setup-go@v5
26+
with:
27+
go-version: '1.23.1'
28+
- name: apt update
29+
run: sudo apt-get update
30+
- name: Install dependencies
31+
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev locate libfuse2
32+
- name: Install project dependencies
33+
run: flutter pub get
34+
- name: Generate intermediates
35+
run: flutter pub run build_runner build --delete-conflicting-outputs
36+
- name: Enable linux build
37+
run: flutter config --enable-linux-desktop
38+
- name: Build artifacts
39+
run: flutter build linux --release
40+
- name: Build go dependencies
41+
run: |
42+
mkdir -p linux/bundle/lib
43+
cd go/binding/desktop
44+
go build -o ../../../build/linux/x64/release/bundle/lib/libmtorrentserver.so -buildmode=c-shared main.go
45+
cd ../../..
46+
- name: Archive app
47+
uses: thedoctor0/zip-release@master
48+
with:
49+
type: 'zip'
50+
filename: Unyo-${{ github.event.inputs.version }}-linux.zip
51+
directory: build/linux/x64/release/bundle
52+
- name: Linux Archive Release
53+
uses: softprops/action-gh-release@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
files: build/linux/x64/release/bundle/Unyo-${{ github.event.inputs.version }}-linux.zip
58+
- name: Copy AppDir
59+
run: cp -r linux-appimage/Unyo.AppDir .
60+
- name: Copy Compiled App
61+
run: cp -r build/linux/x64/release/bundle/* Unyo.AppDir/.
62+
- name: Copy appimagetool
63+
run: cp linux-appimage/appimagetool.AppImage .
64+
- name: Give Permissions
65+
run: chmod 755 appimagetool.AppImage
66+
- name: Execute appimagetool
67+
run: ./appimagetool.AppImage Unyo.AppDir Unyo-${{ github.event.inputs.version }}-linux.AppImage
68+
- name: Linux AppImage Release
69+
uses: softprops/action-gh-release@v1
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
with:
73+
files: /home/runner/work/Unyo/Unyo/Unyo-${{ github.event.inputs.version }}-linux.AppImage
74+
- name: Activate flutter_to_debian
75+
run: dart pub global activate flutter_to_debian
76+
- name: Add Path
77+
run: export PATH="$PATH":"$HOME/.pub-cache/bin"
78+
- name: Build deb package
79+
run: flutter_to_debian
80+
- name: Rename deb file
81+
run: cp build/linux/x64/release/debian/unyo_0.0.0_amd64.deb build/linux/x64/release/debian/unyo-${{ github.event.inputs.version }}-linux.deb
82+
- name: Linux Debian package Release
83+
uses: softprops/action-gh-release@v1
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
with:
87+
files: build/linux/x64/release/debian/unyo-${{ github.event.inputs.version }}-linux.deb
88+
89+
build-and-release-windows:
90+
runs-on: windows-latest
91+
steps:
92+
- uses: actions/checkout@v4
93+
with:
94+
ref: ${{ github.event.inputs.ref }}
95+
- uses: subosito/flutter-action@v2
96+
with:
97+
channel: 'stable'
98+
flutter-version: '3.19.5'
99+
- uses: actions/setup-go@v5
100+
with:
101+
go-version: '1.23.1'
102+
- name: Install project dependencies
103+
run: flutter pub get
104+
- name: Generate intermediates
105+
run: flutter pub run build_runner build --delete-conflicting-outputs
106+
- name: Enable windows build
107+
run: flutter config --enable-windows-desktop
108+
- name: Build artifacts
109+
run: flutter build windows --release
110+
- name: Build go dependencies
111+
run: |
112+
cd go\binding\desktop
113+
go build -o ..\..\..\build\windows\x64\runner\Release\libmtorrentserver.dll -buildmode=c-shared main.go
114+
cd ..\..\..
115+
- name: Archive App
116+
uses: thedoctor0/zip-release@master
117+
with:
118+
type: 'zip'
119+
filename: Unyo-${{ github.event.inputs.version }}-windows.zip
120+
directory: build\windows\x64\runner\Release
121+
- name: Windows Archive Release
122+
uses: softprops/action-gh-release@v1
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
with:
126+
files: build/windows/x64/runner/Release/Unyo-${{ github.event.inputs.version }}-windows.zip
127+
- name: Running installer build
128+
uses: Minionguyjpro/[email protected]
129+
with:
130+
path: .\windows-inno-script.iss
131+
options: /O+ /dMyAppVersion=${{ github.event.inputs.version }}
132+
- name: Windows Exe Release
133+
uses: softprops/action-gh-release@v1
134+
env:
135+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
with:
137+
files: build\windows\x64\runner\unyo-${{ github.event.inputs.version }}-windows-setup.exe
138+
139+
build-and-release-macos:
140+
runs-on: macos-14
141+
steps:
142+
- uses: actions/checkout@v4
143+
with:
144+
ref: ${{ github.event.inputs.ref }}
145+
- uses: subosito/flutter-action@v2
146+
with:
147+
channel: 'stable'
148+
flutter-version: '3.19.5'
149+
- uses: actions/setup-go@v5
150+
with:
151+
go-version: '1.23.1'
152+
- name: Install project dependencies
153+
run: flutter pub get
154+
- name: Generate intermediates
155+
run: flutter pub run build_runner build --delete-conflicting-outputs
156+
- name: Enable macOS build
157+
run: flutter config --enable-macos-desktop
158+
- name: Build artifacts
159+
run: flutter build macos --release
160+
- name: Build go dependencies
161+
run: |
162+
mkdir -p macos/Frameworks
163+
cd go/binding/desktop
164+
go build -o ../../../build/macos/Build/Products/Release/Frameworks/libmtorrentserver.dylib -buildmode=c-shared main.go
165+
cd ../../..
166+
- name: Archive App
167+
uses: thedoctor0/zip-release@master
168+
with:
169+
type: 'zip'
170+
filename: Unyo-${{ github.event.inputs.version }}-macos.zip
171+
directory: build/macos/Build/Products/Release
172+
- name: macOS Archive Release
173+
uses: softprops/action-gh-release@v1
174+
env:
175+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176+
with:
177+
files: build/macos/Build/Products/Release/Unyo-${{ github.event.inputs.version }}-macos.zip
178+
- name: build macos
179+
run: |
180+
cd macos
181+
pod update
182+
cd ..
183+
brew install create-dmg
184+
create-dmg --volname Unyo-${{ github.event.inputs.version }}-macos --window-pos 200 120 --window-size 800 450 --icon-size 100 --app-drop-link 600 185 Unyo-${{ github.event.inputs.version }}-macos.dmg build/macos/Build/Products/Release/unyo.app
185+
- name: macOS dmg Release
186+
uses: softprops/action-gh-release@v1
187+
env:
188+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189+
with:
190+
files: /Users/runner/work/Unyo/Unyo/Unyo-${{ github.event.inputs.version }}-macos.dmg

0 commit comments

Comments
 (0)