-
Notifications
You must be signed in to change notification settings - Fork 19
65 lines (58 loc) · 1.92 KB
/
release.yml
File metadata and controls
65 lines (58 loc) · 1.92 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
62
63
64
65
name: Release CLI
on:
push:
tags:
- "**[0-9]+.[0-9]+.[0-9]+*"
pull_request:
types: [labeled, synchronize]
jobs:
release:
if: >-
github.event_name == 'push' ||
github.event.label.name == 'release-test' ||
contains(github.event.pull_request.labels.*.name, 'release-test')
strategy:
matrix:
include:
- os: ubuntu-24.04
binary: rfd-cli
artifact: rfd-cli-x86_64-unknown-linux-gnu
- os: macos-15
binary: rfd-cli
artifact: rfd-cli-aarch64-apple-darwin
- os: macos-15-intel
binary: rfd-cli
artifact: rfd-cli-x86_64-apple-darwin
- os: windows-2025
binary: rfd-cli.exe
artifact: rfd-cli-x86_64-pc-windows-msvc.exe
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Determine release tag
id: tag
shell: bash
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "value=v0.0.0-pre+${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
else
echo "value=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- run: |
rustup toolchain install
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: Build Release Binary
run: |
cargo build --release --package rfd-cli
- name: Rename Binary
shell: bash
run: |
mv "target/release/${{ matrix.binary }}" "target/release/${{ matrix.artifact }}"
- uses: ncipollo/release-action@caacf56b56ba217c4eaf0a9deb59dbcdd12abfcd
with:
allowUpdates: true
draft: ${{ github.event_name == 'pull_request' }}
tag: ${{ steps.tag.outputs.value }}
artifacts: "target/release/${{ matrix.artifact }}"