-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (72 loc) · 2.54 KB
/
release-cli.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
name: Release Cli
on:
push:
tags:
- "*"
jobs:
build:
name: Release binary
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: dar2oar
asset_name: dar2oar-x86_64-unknown-linux-gnu.tar.gz
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
artifact_name: dar2oar
asset_name: dar2oar-x86_64-unknown-linux-musl.tar.gz
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
artifact_name: dar2oar.exe
asset_name: dar2oar-x86_64-pc-windows-gnu.zip
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: dar2oar
asset_name: dar2oar-x86_64-apple-darwin.zip
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Cross build with all features
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }} --all-features --verbose
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
if: matrix.target == 'x86_64-pc-windows-gnu'
- name: Compress binary
run: |
if [[ "${{ matrix.target }}" == *"linux"* ]]; then
tar -czf ${{ matrix.asset_name }} target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
else
zip -r ${{ matrix.asset_name }} target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
fi
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
release_name: DAR to OAR Converter v${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: "docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]"
file_pattern: CHANGELOG.md
if: matrix.target == 'x86_64-pc-windows-gnu'