-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (47 loc) · 1.39 KB
/
Copy pathmain.yml
File metadata and controls
59 lines (47 loc) · 1.39 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
name: Release NoteNest Binaries
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl
env:
BINARY_NAME: notenest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install Cross
run: cargo install cross --locked
- name: Build with Cross
run: cross build --target ${{ matrix.target }} --release --verbose
- name: Create Release Archive
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/$BINARY_NAME dist/$BINARY_NAME
tar -czvf dist/${{ matrix.target }}.tar.gz -C dist $BINARY_NAME
rm dist/$BINARY_NAME
- name: Upload workflow artifact
uses: actions/upload-artifact@v4
with:
name: notenest-${{ matrix.target }}
path: dist/${{ matrix.target }}.tar.gz
- name: Upload release assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: dist/${{ matrix.target }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}