forked from harmonoid/harmonoid
-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (188 loc) · 6.87 KB
/
master.yml
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Harmonoid
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build_windows:
name: Harmonoid Windows
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
submodules: recursive
- name: Set Git Commit Hash
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check Git Commit Hash
run: echo ${{ steps.vars.outputs.sha_short }}
- uses: subosito/flutter-action@v1
with:
flutter-version: "3.0.0"
channel: "stable"
- run: flutter config --enable-windows-desktop
- run: flutter pub get
- run: flutter build windows
- name: Create PFX
id: create_pfx
uses: timheuer/base64-to-file@v1
with:
fileName: "certificate.pfx"
encodedString: ${{ secrets.CERTIFICATE }}
- run: |
"%programfiles(x86)%\Windows Kits\10\App Certification Kit\signtool.exe" sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /f "${{ steps.create_pfx.outputs.filePath }}" /p ${{ secrets.PASSWORD }} "build/windows/runner/Release/harmonoid.exe"
shell: cmd
- run: cp -r build/windows/runner/Release harmonoid-windows-exe
- run: tar.exe -a -c -f harmonoid-windows-exe.zip harmonoid-windows-exe
- run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "Harmonoid_InnoSetup.iss"
shell: cmd
- run: |
"%programfiles(x86)%\Windows Kits\10\App Certification Kit\signtool.exe" sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /f "${{ steps.create_pfx.outputs.filePath }}" /p ${{ secrets.PASSWORD }} "Output/harmonoid-windows-setup.exe"
shell: cmd
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_REPOSITORY: alexmercerind2/_
with:
repository: alexmercerind2/_
draft: true
prerelease: false
body: ""
tag_name: "vnext"
files: |
Output/harmonoid-windows-setup.exe
harmonoid-windows-exe.zip
token: ${{ secrets.ACCESS_TOKEN }}
- name: Release Nightly
uses: softprops/action-gh-release@v1
env:
GITHUB_REPOSITORY: harmonoid/harmonoid-nightly
with:
repository: harmonoid/harmonoid-nightly
draft: false
prerelease: true
body: ${{ github.sha }}
tag_name: nightly
files: |
Output/harmonoid-windows-setup.exe
harmonoid-windows-exe.zip
token: ${{ secrets.ACCESS_TOKEN_2 }}
build_linux:
name: Harmonoid Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
submodules: recursive
- name: Set Git Commit Hash
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check Git Commit Hash
run: echo ${{ steps.vars.outputs.sha_short }}
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: sudo apt-get update
- run: sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev mpv libmpv-dev dpkg-dev rpm
- run: flutter config --enable-linux-desktop
- run: flutter pub upgrade
- run: flutter pub get
- run: flutter build linux --verbose
- name: Build RPM Package
run: |
cp -fr build/linux/x64/release/bundle linux/debian/usr/share/harmonoid
mkdir linux/debian/usr/bin
ln -sr linux/debian/usr/share/harmonoid/harmonoid linux/debian/usr/bin/harmonoid
sed -i "s:cp -rf :cp -rf $(pwd)/:" linux/rpm/harmonoid.spec
cd linux/debian
sed -i "s:FILES_HERE:$(find usr \( -type l -o -type f \) -follow -print | awk '{printf "/%s\\n", $0}'):" ../rpm/harmonoid.spec
cd ../../
rpmbuild -bb linux/rpm/harmonoid.spec -D "_topdir $(pwd)/rpmbuild"
cp rpmbuild/RPMS/x86_64/*.rpm harmonoid-linux-x86_64.rpm
- name: Build DEB Package
run: |
dpkg-deb --build --root-owner-group linux/debian
cp linux/*.deb harmonoid-linux-x86_64.deb
- name: Build Tarball
run: |
mkdir -p AppDir/
cp -r linux/debian/usr AppDir/
ln -sr AppDir/usr/bin/harmonoid AppDir/harmonoid
tar czf harmonoid-linux-x86_64.tar.gz -C AppDir/ .
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_REPOSITORY: alexmercerind2/_
with:
repository: alexmercerind2/_
draft: true
prerelease: false
body: ""
tag_name: "vnext"
files: harmonoid-linux-*
token: ${{ secrets.ACCESS_TOKEN }}
- name: Release Nightly
uses: softprops/action-gh-release@v1
env:
GITHUB_REPOSITORY: harmonoid/harmonoid-nightly
with:
repository: harmonoid/harmonoid-nightly
draft: false
prerelease: true
body: ${{ github.sha }}
tag_name: nightly
files: harmonoid-linux-*
token: ${{ secrets.ACCESS_TOKEN_2 }}
build_android:
name: Harmonoid Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
submodules: recursive
- name: Set Git Commit Hash
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check Git Commit Hash
run: echo ${{ steps.vars.outputs.sha_short }}
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Create Key Store
id: create_key_store
uses: timheuer/base64-to-file@v1
with:
fileName: "keystore.pfx"
encodedString: ${{ secrets.KEY_STORE }}
- name: Create Key Properties
id: create_key_properties
uses: timheuer/base64-to-file@v1
with:
fileName: "key.properties"
encodedString: ${{ secrets.KEY_PROPERTIES }}
- run: cp "${{ steps.create_key_store.outputs.filePath }}" android/app/keystore.jks
- run: cp "${{ steps.create_key_properties.outputs.filePath }}" android/key.properties
- run: flutter pub upgrade
- run: flutter pub get
- run: flutter build apk --verbose
- run: cp build/app/outputs/flutter-apk/app-release.apk harmonoid-android.apk
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_REPOSITORY: alexmercerind2/_
with:
repository: alexmercerind2/_
draft: true
prerelease: false
body: ""
tag_name: "vnext"
files: |
harmonoid-android.apk
token: ${{ secrets.ACCESS_TOKEN }}