This repository has been archived by the owner on Aug 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (55 loc) · 1.87 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
name: Build and upload release binary
on:
push:
tags:
- "v*.*.*"
jobs:
release:
strategy:
matrix:
compile:
- name: Alpine (x86_64)
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- name: Ubuntu (x86_64)
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- name: Ubuntu (arm64)
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- name: MacOS (x86_64)
os: macOS-latest
target: x86_64-apple-darwin
- name: MacOS (arm64)
os: macOS-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.compile.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.compile.target }}
override: true
- name: Configure ${{ matrix.compile.name }}
if: ${{ matrix.compile.os == 'ubuntu-latest' }}
run: |
# Ref: https://github.com/napi-rs/node-rs/blob/main/.cargo/config.toml
sudo apt-get install -y musl-tools gcc-aarch64-linux-gnu
echo '[target.aarch64-unknown-linux-gnu]' > ~/.cargo/config.toml
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.compile.target }} --features vendored -v
- name: Rename
run: mv target/${{ matrix.compile.target }}/release/vault-k8s-helper vault-k8s-helper-${{ matrix.compile.target }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: vault-k8s-helper-${{ matrix.compile.target }}