-
Notifications
You must be signed in to change notification settings - Fork 34
81 lines (70 loc) · 2.15 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
77
78
79
80
81
name: Release Binary
on:
push:
tags:
- 'irust@[0-9]+.[0-9]+.[0-9]+'
# Manual trigger
workflow_dispatch:
inputs:
tag:
description: 'Tag for release (e.g., irust@0.1.0)'
required: true
default: 'test-release'
permissions:
contents: write
jobs:
build:
name: Release libs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
# Build for Musl
- if: runner.os == 'Linux'
name: Build Linux musl binary
run: |
rustup target add x86_64-unknown-linux-musl
cargo build --release --target=x86_64-unknown-linux-musl
####################################
- name: Build
if: runner.os != 'Linux'
run: cargo build --release
- if: matrix.os == 'macos-13'
name: Upload MacOS x86_64 Binary
uses: svenstaro/upload-release-action@v2
with:
file: target/release/irust
asset_name: irust-x86_64-apple-darwin
tag: ${{ github.event.inputs.tag || github.ref }}
overwrite: true
- if: matrix.os == 'macos-latest'
name: Upload MacOS aarch64 Binary
uses: svenstaro/upload-release-action@v2
with:
file: target/release/irust
asset_name: irust-aarch64-apple-darwin
tag: ${{ github.event.inputs.tag || github.ref }}
overwrite: true
- if: runner.os == 'Linux'
name: Upload Linux binary
uses: svenstaro/upload-release-action@v2
with:
file: target/x86_64-unknown-linux-musl/release/irust
asset_name: irust-x86_64-unknown-linux-musl
tag: ${{ github.event.inputs.tag || github.ref }}
overwrite: true
- if: runner.os == 'Windows'
name: Upload Windows binary
uses: svenstaro/upload-release-action@v2
with:
file: target/release/irust.exe
asset_name: irust-x86_64-pc-windows-msvc.exe
tag: ${{ github.event.inputs.tag || github.ref }}
overwrite: true