-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.83 KB
/
main.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
name: Release CI
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
cross_platform_build:
strategy:
matrix:
include:
- target: aarch64-unknown-linux-musl
output_name: linux_aarch64.tar.gz
- target: arm-unknown-linux-musleabihf
output_name: linux_armv6.tar.gz
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Install stable rust, and associated tools
- name: install rust
uses: dtolnay/rust-toolchain@stable
# Install cross-rs
- name: install cross
run: cargo install cross --git https://github.com/cross-rs/cross
# Build binary
- name: build
run: cross build --target ${{ matrix.target }} --release
# Compress the output
- name: compress
run: |
tar -C "target/${{ matrix.target }}/release" -czf "./leafcast_${{ matrix.output_name }}" leafcast
# Upload output for release page
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ matrix.target }}
path: leafcast_${{ matrix.output_name }}
retention-days: 1
###################
## Create release #
###################
create_release:
needs: [cross_platform_build]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup | Artifacts
uses: actions/download-artifact@v4
- name: Update Release
uses: ncipollo/release-action@v1
with:
makeLatest: true
name: ${{ github.ref_name }}
tag: ${{ github.ref }}
bodyFile: ".github/release-body.md"
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: |
**/leafcast_*.tar.gz