-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 1.94 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
75
76
name: Build and Release
permissions:
contents: write
on:
push:
tags:
- v*
env:
PROJECT_NAME: pim
jobs:
build:
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- {
os: ubuntu-latest,
target: x86_64-unknown-linux-gnu,
use-cross: false,
extension: "",
}
- {
os: ubuntu-latest,
target: aarch64-unknown-linux-gnu,
use-cross: true,
extension: "",
}
- {
os: macos-latest,
target: x86_64-apple-darwin,
use-cross: false,
extension: "",
}
- {
os: macos-latest,
target: aarch64-apple-darwin,
use-cross: false,
extension: "",
}
- {
os: windows-latest,
target: x86_64-pc-windows-msvc,
use-cross: false,
extension: .exe,
}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.job.target }}
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --release --target ${{ matrix.job.target }}
- name: Rename artifacts
run: |
mv target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ matrix.job.extension }} ${{ env.PROJECT_NAME }}-${{ github.ref_name }}-${{ matrix.job.target }}${{ matrix.job.extension }}
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{ env.PROJECT_NAME }}-${{ github.ref_name }}-${{ matrix.job.target }}${{ matrix.job.extension }}