-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (69 loc) · 2.06 KB
/
releases.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: Release
on:
push:
tags:
- "v*" # Triggers the workflow on version tags like v1.0.0
jobs:
build:
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
extension: ""
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
extension: ""
use-cross: true
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
extension: ""
use-cross: true
- os: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
extension: ""
use-cross: true
- os: macos-latest
target: x86_64-apple-darwin
extension: ""
- os: macos-11
target: aarch64-apple-darwin
extension: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
extension: ".exe"
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Install cross
if: ${{ !startsWith(matrix.os, 'windows') }}
shell: bash
run: |
if [ "${{ matrix.use-cross }}" = "true" ]; then
cargo install cross
else
echo "This platform does not need cross"
fi
- name: Build the project
run: |
if [ "${{ matrix.use-cross }}" = "true" ]; then
cross build --release --target ${{ matrix.target }}
else
cargo build --release --target ${{ matrix.target }}
fi
shell: bash
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.target }}/release/weaveconfig${{ matrix.extension }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}