-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (63 loc) · 1.99 KB
/
release.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
name: Release
on:
push:
tags: [ v* ]
jobs:
build_and_release:
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: ".exe"
oname: ""
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
ext: ""
oname: "-linux"
- os: macos-latest
target: x86_64-apple-darwin
ext: ""
oname: "-darwin"
- os: macos-latest
target: aarch64-apple-darwin
ext: ""
oname: "-darwin_arm64"
steps:
- name: install musl tools
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y musl musl-dev musl-tools
- uses: actions/checkout@v4
name: checkout
with:
fetch-depth: 1
- uses: dtolnay/rust-toolchain@stable
name: check and build
with:
target: ${{ matrix.target }}
components: clippy
- run: cargo clippy --target ${{ matrix.target }} -q --release
- run: cargo test --target ${{ matrix.target }} --verbose --release
if: ${{ matrix.target != 'aarch64-apple-darwin' }}
- run: cargo build --target ${{ matrix.target }} --verbose --release
- uses: svenstaro/upload-release-action@v2
name: Upload binaries to release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: target/${{ matrix.target }}/release/fse_dump${{ matrix.ext }}
asset_name: fse_dump-${{ github.ref_name }}${{ matrix.oname }}${{ matrix.ext }}
publish:
name: Publish
needs: build_and_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}