-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
153 lines (139 loc) · 4.71 KB
/
spotube-release-binary.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
name: Spotube Release Binary
on:
workflow_dispatch:
inputs:
debug:
type: boolean
default: false
description: Debug with SSH toggle
required: false
channel:
type: choice
options:
- stable
- nightly
default: nightly
description: The release channel
dry_run:
type: boolean
default: false
description: Dry run without uploading to release
env:
FLUTTER_VERSION: 3.19.5
jobs:
build_platform:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
files: |
dist/Spotube-linux-x86_64.deb
dist/Spotube-linux-x86_64.rpm
dist/spotube-linux-*-x86_64.tar.xz
- os: ubuntu-latest
platform: android
files: |
build/Spotube-android-all-arch.apk
build/Spotube-playstore-all-arch.aab
- os: windows-latest
platform: windows
files: |
dist/Spotube-windows-x86_64.nupkg
dist/Spotube-windows-x86_64-setup.exe
- os: macos-latest
platform: ios
files: |
Spotube-iOS.ipa
- os: macos-14
platform: macos
files: |
build/Spotube-macos-universal.dmg
build/Spotube-macos-universal.pkg
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: subosito/[email protected]
with:
cache: true
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Setup Java
if: ${{matrix.platform == 'android'}}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
check-latest: true
- name: Install ${{matrix.platform}} dependencies
run: dart cli/cli.dart install-dependencies --platform=${{matrix.platform}}
- name: Sign Apk
if: ${{matrix.platform == 'android'}}
run: |
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
- name: Build ${{matrix.platform}} binaries
run: dart cli/cli.dart build ${{matrix.platform}}
env:
CHANNEL: ${{inputs.channel}}
DOTENV: ${{secrets.DOTENV_RELEASE}}
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: Spotube-Release-Binaries
path: ${{matrix.files}}
- name: Debug With SSH When fails
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
upload:
runs-on: ubuntu-latest
needs:
- build_platform
steps:
- uses: actions/download-artifact@v3
with:
name: Spotube-Release-Binaries
path: ./Spotube-Release-Binaries
- name: Install dependencies
run: sudo apt-get install tree -y
- name: Generate Checksums
run: |
tree .
md5sum Spotube-Release-Binaries/* >> RELEASE.md5sum
sha256sum Spotube-Release-Binaries/* >> RELEASE.sha256sum
sed -i 's|Spotube-Release-Binaries/||' RELEASE.sha256sum RELEASE.md5sum
- name: Extract pubspec version
run: |
echo "PUBSPEC_VERSION=$(grep -oP 'version:\s*\K[^+]+(?=\+)' pubspec.yaml)" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: Spotube-Release-Binaries
path: |
RELEASE.md5sum
RELEASE.sha256sum
- name: Upload Release Binaries (stable)
if: ${{ !inputs.dry_run && inputs.channel == 'stable' }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ env.PUBSPEC_VERSION }} # mind the "v" prefix
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
allowUpdates: true
artifacts: Spotube-Release-Binaries/*,RELEASE.sha256sum,RELEASE.md5sum
- name: Upload Release Binaries (nightly)
if: ${{ !inputs.dry_run && inputs.channel == 'nightly' }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
allowUpdates: true
artifacts: Spotube-Release-Binaries/*,RELEASE.sha256sum,RELEASE.md5sum
body: 'Build Number: ${{github.run_number}}'