-
-
Notifications
You must be signed in to change notification settings - Fork 38
63 lines (50 loc) · 1.21 KB
/
build.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
---
name: Build
on:
push:
tags:
- '*'
workflow_dispatch:
permissions:
contents: write
jobs:
test:
uses: ./.github/workflows/test.yml
build:
name: Test build
runs-on: ${{ matrix.os }}
needs: test
strategy:
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- build: macos
os: macos-latest
target: x86_64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get the release version from the tag
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: |
cargo build --release --target ${{ matrix.target }}
publish:
name: Publish
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}