-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (77 loc) · 2.4 KB
/
Copy pathrelease.yml
File metadata and controls
88 lines (77 loc) · 2.4 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ github.ref_name }}
run: |
if gh release view "$TAG_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
echo "Release $TAG_NAME already exists"
exit 0
fi
args=()
if [[ "$TAG_NAME" == *-* ]]; then
args+=(--prerelease)
fi
gh release create "$TAG_NAME" \
--repo "$GITHUB_REPOSITORY" \
--title "$TAG_NAME" \
--generate-notes \
"${args[@]}"
build:
needs: create-release
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset_suffix: linux-amd64
binary_name: gh-pilot
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
asset_suffix: linux-arm64
binary_name: gh-pilot
- os: macos-14
target: aarch64-apple-darwin
asset_suffix: darwin-arm64
binary_name: gh-pilot
- os: windows-2025-vs2026
target: x86_64-pc-windows-msvc
asset_suffix: windows-amd64.exe
binary_name: gh-pilot.exe
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2.9.1
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Build release binary
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Stage extension binary
shell: bash
env:
TAG_NAME: ${{ github.ref_name }}
ASSET_SUFFIX: ${{ matrix.asset_suffix }}
BINARY_NAME: ${{ matrix.binary_name }}
TARGET: ${{ matrix.target }}
run: |
mkdir -p dist
cp "target/$TARGET/release/$BINARY_NAME" "dist/gh-pilot_${TAG_NAME}_${ASSET_SUFFIX}"
- name: Upload extension binary
shell: bash
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ github.ref_name }}
run: gh release upload "$TAG_NAME" dist/* --repo "$GITHUB_REPOSITORY" --clobber