-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (50 loc) · 1.86 KB
/
release-tune-cli.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
name: Create tune-cli release assets
on:
release:
types: [created]
jobs:
create-release-assets:
name: Create tune-cli ${{ matrix.target }} release
if: startsWith(github.event.release.tag_name, 'tune-cli')
runs-on: ${{ matrix.os }}
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: x86_64-apple-darwin
os: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt update && sudo apt install libasound2-dev
- name: Install ${{ matrix.target }} target
run: rustup target add ${{ matrix.target }}
- name: Build tune-cli
run: cargo b --release -p tune-cli --target ${{ matrix.target }}
- name: Package tune-cli with zip
if: matrix.os != 'windows-latest'
run: zip --junk-paths tune-cli target/${{ matrix.target}}/release/tune tune-cli/README.md
- name: Package tune-cli with 7z
if: matrix.os == 'windows-latest'
run: 7z a tune-cli.zip ./target/${{ matrix.target}}/release/tune.exe ./tune-cli/README.md
- name: Upload tune-cli release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./tune-cli.zip
asset_name: ${{ github.event.release.tag_name }}-${{ matrix.target }}.zip
asset_content_type: application/zip