-
Notifications
You must be signed in to change notification settings - Fork 7
242 lines (213 loc) · 9.43 KB
/
build.yaml
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: Publish
on:
workflow_dispatch:
inputs:
version:
description: 'Version to bump to'
required: true
type: choice
options:
- patch
- minor
- major
update_frontend:
description: 'Try to pull the latest changes from the frontend repository (companion branch)'
required: false
type: boolean
default: true
jobs:
update_version:
permissions:
contents: write
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.semver.outputs.semantic-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Update frontend
if: ${{ inputs.update_frontend == 'true' }}
run: |
cd frontend
git pull
cd ..
- id: semver
uses: SOLIDSoftworks/semver-tags@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
tag-prefix: 'v'
incremented-value: ${{ inputs.version }}
- name: NPM-Version
uses: Reedyuk/[email protected]
with:
version: ${{ steps.semver.outputs.semantic-version }}
- name: Update cargo and tauri version
run: |
sudo apt install jq
sed -i '0,/\(version *= *\).*/s//\1"${{ steps.semver.outputs.semantic-version }}"/' src-tauri/Cargo.toml
jq '.version="${{ steps.semver.outputs.semantic-version }}"' src-tauri/tauri.conf.json > tauri.config.json.new && mv tauri.config.json.new src-tauri/tauri.conf.json
sed -i '/name = "music-assistant-companion"/{N;s/\(version *= *\)".*"/\1"'"${{ steps.semver.outputs.semantic-version }}"'"/;}' src-tauri/Cargo.lock
- name: Commit and push changes
run: |
git config --global user.name "Jonathan Bangert"
git config --global user.email "[email protected]"
git add -A
git commit -m "Update version to ${{ steps.semver.outputs.semantic-version }}"
git push
build:
needs: update_version
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest, macos-15]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Pull latest changes
run: |
git pull
- name: Install dependencies (Linux)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev libsoup2.4-dev libxcb-xfixes0-dev libxcb-shape0-dev patchelf
sudo apt install -y \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
libsoup-3.0-dev \
librsvg2-dev;
sudo apt install -y \
libwebkit2gtk-4.0-37=2.36.0-2ubuntu1 \
libwebkit2gtk-4.0-dev=2.36.0-2ubuntu1 \
libjavascriptcoregtk-4.0-18=2.36.0-2ubuntu1 \
libjavascriptcoregtk-4.0-dev=2.36.0-2ubuntu1 \
gir1.2-javascriptcoregtk-4.0=2.36.0-2ubuntu1 \
gir1.2-webkit2-4.0=2.36.0-2ubuntu1;
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
- name: Install Rust (Stable)
run:
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install Rust aarch (Mac)
if: matrix.platform == 'macos-latest'
run: rustup target add aarch64-apple-darwin
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
cache-on-failure: true
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn' # Set this to npm, yarn or pnpm.
- name: Install frontend dependencies
if: matrix.platform != 'windows-latest'
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: yarn install && cd $GITHUB_WORKSPACE/frontend/ && yarn install && cd $GITHUB_WORKSPACE # Change this to npm, yarn or pnpm.
- name: Install frontend dependencies (Windows)
if: matrix.platform == 'windows-latest'
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: yarn install && cd $env:GITHUB_WORKSPACE/frontend/ && yarn install && cd $env:GITHUB_WORKSPACE # Change this to npm, yarn or pnpm.
- name: Build the app (Linux)
if: matrix.platform == 'ubuntu-22.04'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: v${{ needs.update_version.outputs.version }}
releaseName: "Music Assistant Companion App ${{ needs.update_version.outputs.version }}"
releaseBody: "Fixes"
- name: Build the app (Windows)
if: matrix.platform == 'windows-latest'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: v${{ needs.update_version.outputs.version }}
releaseName: "Music Assistant Companion App ${{ needs.update_version.outputs.version }}"
releaseBody: "Fixes"
- name: Build the app (Mac (Apple Silicon))
if: matrix.platform == 'macos-latest'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
args: --target aarch64-apple-darwin
tagName: v${{ needs.update_version.outputs.version }}
releaseName: "Music Assistant Companion App ${{ needs.update_version.outputs.version }}"
releaseBody: "Fixes"
# - name: Upload app to app store
# if: matrix.platform == 'macos-latest'
# run: |
# unset APPLE_SIGNING_IDENTITY
# unset APPLE_CERTIFICATE
# sign_app="3rd Party Mac Developer Application: COMPANY_NAME (TEAM_ID)"
# sign_install="3rd Party Mac Developer Installer: COMPANY_NAME (TEAM_ID)"
# profile="src-tauri/Mac_App_Distribution.provisionprofile"
#
# app_path="src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Music Assistant Companion.app"
# build_name="src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Music Assistant Companion.pkg"
# cp_dir="src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Music Assistant Companion.app/Contents/embedded.provisionprofile"
# entitlements="src-tauri/Entitlements.plist"
#
# cp "${profile}" "${cp_dir}"
#
# codesign --deep --force -s "${sign_app}" --entitlements ${entitlements} "${app_path}"
#
# productbuild --component "${app_path}" /Applications/ --sign "${sign_install}" "${build_name}"
#
# xcrun altool --upload-app -f file -t platform -u username [-p password]
- name: Build the app (Mac)
if: matrix.platform == 'macos-15'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
tagName: v${{ needs.update_version.outputs.version }}
releaseName: "Music Assistant Companion App ${{ needs.update_version.outputs.version }}"
releaseBody: "Fixes"
- name: Upload linux binary
if: matrix.platform == 'ubuntu-22.04'
uses: svenstaro/upload-release-action@v2
with:
tag: v${{ needs.update_version.outputs.version }}
asset_name: music-assistant-companion-${{ needs.update_version.outputs.version }}
file: src-tauri/target/release/music-assistant-companion
- name: Upload squeezelite binary
if: matrix.platform == 'ubuntu-22.04'
uses: svenstaro/upload-release-action@v2
with:
tag: v${{ needs.update_version.outputs.version }}
file: src-tauri/bin/squeezelite-x86_64-unknown-linux-gnu