-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.63 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (50 loc) · 1.63 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
name: Release Subtext CLI
on:
push:
tags:
- 'v*' # Trigger on version tags (e.g., v1.0.0)
permissions:
contents: write
jobs:
build-and-release:
name: Build & Release (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: subtext
asset_name: subtext-linux-amd64
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: subtext
asset_name: subtext-macos-amd64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: subtext.exe
asset_name: subtext-windows-amd64.exe
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build Release Binary
run: cargo build --release --target ${{ matrix.target }}
- name: Prepare Asset (Unix)
if: runner.os != 'Windows'
run: |
cd target/${{ matrix.target }}/release
mv ${{ matrix.artifact_name }} ${{ matrix.asset_name }}
- name: Prepare Asset (Windows)
if: runner.os == 'Windows'
run: |
cd target/${{ matrix.target }}/release
Rename-Item ${{ matrix.artifact_name }} ${{ matrix.asset_name }}
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: target/${{ matrix.target }}/release/${{ matrix.asset_name }}