-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (50 loc) · 1.67 KB
/
cli-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
name: cli-release
on:
workflow_dispatch:
inputs:
tag:
description: release/tag to upload artifacts to
required: true
type: string
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
build-cli:
defaults:
shell: bash
strategy:
matrix:
arch: ["x86_64", "aarch64"]
target: [
{ os: "ubuntu-latest", triple-suffix: "unknown-linux-gnu" },
{ os: "windows-latest", triple-suffix: "pc-windows-msvc" },
{ os: "macos-latest", triple-suffix: "apple-darwin" }
]
runs-on: ${{ matrix.target.os }}
steps:
- name: Resolve inputs
id: resolve-inputs
# Use tag input if available, otherwise parse it out of the git ref
run: |
TAG_INPUT=${{ inputs.tag }}
echo "tag=${TAG_INPUT:-GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
echo "triple=${{ format('{0}-{1}', matrix.arch, matrix.target.triple-suffix) }}" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
target: ${{ steps.resolve-inputs.outputs.triple }}
args: "--locked --release --package divviup-cli"
strip: true
- name: Publish
env:
GH_TOKEN: '${{ secrets.DIVVIUP_GITHUB_AUTOMATION_RELEASE_PAT }}'
run: |
cp target/${{ steps.resolve-inputs.outputs.triple }}/release/divviup \
divviup-${{ steps.resolve-inputs.outputs.triple }}
gh release upload \
${{ steps.resolve-inputs.outputs.tag }} divviup-${{ steps.resolve-inputs.outputs.triple }} \
--clobber