-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (78 loc) · 3.64 KB
/
lair-binaries.yaml
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
name: 'release-lair-binaries'
on:
workflow_call:
inputs:
lair-version:
required: true
type: string
jobs:
publish-lair-binaries:
strategy:
fail-fast: false
matrix:
platform: [windows-2019, macos-latest, macos-13, ubuntu-22.04]
permissions:
contents: write
runs-on: ${{ matrix.platform }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Checks out a copy of your repository on the ubuntu-latest machine
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20
- id: create-release
uses: ncipollo/release-action@v1
with:
body: 'Lair binaries for Linux/Windows/macOS.'
prerelease: true
skipIfReleaseExists: true
tag: lair-binaries-${{ inputs.lair-version }}
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
- name: setup binaries (Windows only)
if: matrix.platform == 'windows-2019'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cargo install lair_keystore --version ${{ inputs.lair-version }}
$LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition
Copy-Item $LkPath -Destination "lair-keystore-v${{ inputs.lair-version }}-x86_64-pc-windows-msvc.exe"
CertUtil -hashfile "lair-keystore-v${{ inputs.lair-version }}-x86_64-pc-windows-msvc.exe" SHA256
gh release upload "lair-binaries-${{ inputs.lair-version }}" "lair-keystore-v${{ inputs.lair-version }}-x86_64-pc-windows-msvc.exe"
- name: setup binaries (macos-latest only)
if: matrix.platform == 'macos-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rustup target add aarch64-apple-darwin
cargo install lair_keystore --version ${{ inputs.lair-version }} --target aarch64-apple-darwin
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH lair-keystore-v${{ inputs.lair-version }}-aarch64-apple-darwin
shasum -a 256 lair-keystore-v${{ inputs.lair-version }}-aarch64-apple-darwin
gh release upload "lair-binaries-${{ inputs.lair-version }}" "lair-keystore-v${{ inputs.lair-version }}-aarch64-apple-darwin"
- name: setup binaries (macos-13 only)
if: matrix.platform == 'macos-13'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rustup target add x86_64-apple-darwin
cargo install lair_keystore --version ${{ inputs.lair-version }} --target x86_64-apple-darwin
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH lair-keystore-v${{ inputs.lair-version }}-x86_64-apple-darwin
shasum -a 256 lair-keystore-v${{ inputs.lair-version }}-x86_64-apple-darwin
gh release upload "lair-binaries-${{ inputs.lair-version }}" "lair-keystore-v${{ inputs.lair-version }}-x86_64-apple-darwin"
- name: setup binaries (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cargo install lair_keystore --version ${{ inputs.lair-version }}
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH lair-keystore-v${{ inputs.lair-version }}-x86_64-unknown-linux-gnu
shasum -a 256 lair-keystore-v${{ inputs.lair-version }}-x86_64-unknown-linux-gnu
gh release upload "lair-binaries-${{ inputs.lair-version }}" "lair-keystore-v${{ inputs.lair-version }}-x86_64-unknown-linux-gnu"