-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.84 KB
/
publish_binaries.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
release:
types: [published]
env:
CARGO_TERM_COLOR: always
LLVM-MINGW-TOOLCHAIN-NAME: llvm-mingw-20240619-ucrt-ubuntu-20.04-x86_64
PROJECT_NAME: zffmount
jobs:
build:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
matrix:
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
libacl: libacl1-dev
aarch64-compiler: gcc-aarch64-linux-gnu
toolchain: stable
target: x86_64-unknown-linux-gnu
aarch64-target: aarch64-unknown-linux-gnu
name: Linux (Ubuntu 20.04)
fid: x86_64-linux
aarch64-fid: aarch64-linux
steps:
- uses: actions/checkout@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
components: clippy
default: true
- name: Install acl-deps (Linux only)
if: matrix.os == 'ubuntu-20.04'
run: sudo apt-get install -y ${{ matrix.libacl }} ${{ matrix.aarch64-compiler }}
- name: Build ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.target }}
- name: Build ${{ matrix.aarch64-target }}
if: matrix.os == 'ubuntu-20.04'
run: cargo build --release --target ${{ matrix.aarch64-target }}
- name: Create release directory
run: mkdir -p release
- name: Move executable (Linux)
if: matrix.os == 'ubuntu-20.04'
run: mv target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }} release/${{ env.PROJECT_NAME }}-${{ matrix.fid }}
- name: Move executable (Linux aarch64)
if: matrix.os == 'ubuntu-20.04'
run: mv target/${{ matrix.aarch64-target }}/release/${{ env.PROJECT_NAME }} release/${{ env.PROJECT_NAME }}-${{ matrix.aarch64-fid }}
- name: Upload Release Asset
uses: actions/upload-artifact@v2
with:
name: ${{ env.PROJECT_NAME }}-${{ matrix.fid }}
path: release
- name: Upload Linux aarch64 Release Asset
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-20.04'
with:
name: ${{ env.PROJECT_NAME }}-${{ matrix.aarch64-fid }}
path: release
release:
needs: build
runs-on: ubuntu-20.04
steps:
- name: Download binaries
uses: actions/download-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}-x86_64-linux
path: ./release
- name: Download Linux aarch64 binaries
uses: actions/download-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}-aarch64-linux
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
release/${{ env.PROJECT_NAME }}-x86_64-linux
release/${{ env.PROJECT_NAME }}-aarch64-linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}