-
Notifications
You must be signed in to change notification settings - Fork 7
202 lines (168 loc) · 5.87 KB
/
Copy pathrelease.yml
File metadata and controls
202 lines (168 loc) · 5.87 KB
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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-windows:
name: Build Windows release
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Cache cargo registry
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-x86_64-pc-windows-msvc
restore-keys: ${{ runner.os }}-cargo-
- name: Build release binary
run: cargo build --release --target x86_64-pc-windows-msvc
- name: Prepare release artifact
shell: pwsh
run: |
$version = "${{ github.ref_name }}"
New-Item -ItemType Directory -Force -Path dist | Out-Null
Copy-Item "target\x86_64-pc-windows-msvc\release\reverbic.exe" "dist\reverbic-$version-x86_64-windows.exe"
- name: Upload Windows artifact
uses: actions/upload-artifact@v7
with:
name: release-windows
path: dist/*
if-no-files-found: error
build-macos:
name: Build macOS release (${{ matrix.target }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
asset_arch: x86_64
- target: aarch64-apple-darwin
asset_arch: aarch64
steps:
- uses: actions/checkout@v7
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo registry
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.target }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Package release artifact
run: |
set -euo pipefail
version="${{ github.ref_name }}"
archive="reverbic-${version}-${{ matrix.asset_arch }}-macos.tar.gz"
staging="dist/staging/${{ matrix.target }}"
mkdir -p "$staging" dist
cp "target/${{ matrix.target }}/release/reverbic" "$staging/reverbic"
chmod 755 "$staging/reverbic"
tar -C "$staging" -czf "dist/$archive" reverbic
- name: Upload macOS artifact
uses: actions/upload-artifact@v7
with:
name: release-macos-${{ matrix.target }}
path: dist/*.tar.gz
if-no-files-found: error
build-linux:
name: Build Linux release (x86_64)
# Pinned to 22.04 to link against glibc 2.35 for broad distro compatibility.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libasound2-dev
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: Cache cargo registry
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-x86_64-unknown-linux-gnu
restore-keys: ${{ runner.os }}-cargo-
- name: Build release binary
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Package release artifact
run: |
set -euo pipefail
version="${{ github.ref_name }}"
archive="reverbic-${version}-x86_64-linux.tar.gz"
staging="dist/staging/x86_64-unknown-linux-gnu"
mkdir -p "$staging" dist
cp "target/x86_64-unknown-linux-gnu/release/reverbic" "$staging/reverbic"
chmod 755 "$staging/reverbic"
tar -C "$staging" -czf "dist/$archive" reverbic
- name: Upload Linux artifact
uses: actions/upload-artifact@v7
with:
name: release-linux-x86_64
path: dist/*.tar.gz
if-no-files-found: error
publish:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs:
- build-windows
- build-macos
- build-linux
steps:
- name: Download release artifacts
uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true
- name: Generate checksums
run: |
set -euo pipefail
cd dist
sha256sum reverbic-${{ github.ref_name }}-* > checksums.txt
cat checksums.txt
- name: Publish GitHub Release
uses: softprops/action-gh-release@v3
with:
name: Reverbic ${{ github.ref_name }}
body: |
## Reverbic ${{ github.ref_name }}
### Quick install
**Scoop**
```powershell
scoop bucket add reverbic https://github.com/sewandev/scoop-reverbic
scoop install reverbic
```
**Direct download**
Download the artifact for your platform from this release. SHA256 hashes are published in `checksums.txt`.
---
See the [README](https://github.com/sewandev/Reverbic#readme) for Spotify setup instructions.
files: |
dist/reverbic-${{ github.ref_name }}-x86_64-windows.exe
dist/reverbic-${{ github.ref_name }}-x86_64-macos.tar.gz
dist/reverbic-${{ github.ref_name }}-aarch64-macos.tar.gz
dist/reverbic-${{ github.ref_name }}-x86_64-linux.tar.gz
dist/checksums.txt
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}