-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (69 loc) · 2.09 KB
/
Copy pathrelease.yml
File metadata and controls
84 lines (69 loc) · 2.09 KB
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
82
83
84
name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary: sinbo
asset_name: sinbo-linux-x86_64
- os: macos-latest
target: x86_64-apple-darwin
binary: sinbo
asset_name: sinbo-macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
binary: sinbo
asset_name: sinbo-macos-aarch64
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: sinbo.exe
asset_name: sinbo-windows-x86_64.exe
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Rename binary (Linux/macOS)
if: matrix.os != 'windows-latest'
run: cp target/${{ matrix.target }}/release/${{ matrix.binary }} ${{ matrix.asset_name }}
- name: Rename binary (Windows)
if: matrix.os == 'windows-latest'
run: Copy-Item target/${{ matrix.target }}/release/${{ matrix.binary }} ${{ matrix.asset_name }}
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.asset_name }}
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}