-
Notifications
You must be signed in to change notification settings - Fork 45
61 lines (51 loc) · 2.19 KB
/
publish-cli.yml
File metadata and controls
61 lines (51 loc) · 2.19 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
60
61
name: Publish CLI
on:
workflow_dispatch:
inputs:
tag:
required: true
jobs:
publish-cli:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above).
target: "aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs.
target: "x86_64-apple-darwin"
- platform: "ubuntu-22.04" # Ubuntu 22.04 x86_64 (Works on 24.04 as well)
target: "x86_64-unknown-linux-gnu"
- platform: "windows-latest" # Windows x86_64
target: "x86_64-pc-windows-msvc"
args: "--features appbound"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Rust cache
uses: swatinem/rust-cache@v2
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Build
run: cargo build ${{ matrix.args }} --target ${{ matrix.target }} --package rookie-cli --bin rookie --release
- name: Rename Unix
run: mv target/${{ matrix.target }}/release/rookie rookie-cli-${{ matrix.target }}
if: contains(matrix.platform, 'macos') || contains(matrix.platform, 'ubuntu')
- name: Rename Windows
run: Move-Item target/${{ matrix.target }}/release/rookie.exe rookie-cli-${{ matrix.target }}.exe
if: contains(matrix.platform, 'windows')
- name: Upload Unix
run: gh release upload ${{ github.event.inputs.tag }} rookie-cli-${{ matrix.target }} --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: contains(matrix.platform, 'macos') || contains(matrix.platform, 'ubuntu')
- name: Upload Windows
run: gh release upload ${{ github.event.inputs.tag }} rookie-cli-${{ matrix.target }}.exe --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: contains(matrix.platform, 'windows')