-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (49 loc) · 1.63 KB
/
Copy pathrust.yml
File metadata and controls
56 lines (49 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
name: Build and Release
permissions:
contents: write
on:
release:
types: [created]
jobs:
build:
name: Build and Release Binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
- name: Install dependencies (Linux only)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libglib2.0-dev pkg-config
- name: Install dependencies (macOS only)
if: runner.os == 'macOS'
run: brew install glib pkg-config
# Build the project
- name: Build
run: cargo build --release
# Prepare binary for upload per OS
- name: Prepare binary
run: |
BINARY_NAME="cast_viewer"
if [ "${{ runner.os }}" = "Windows" ]; then
mv target/release/${BINARY_NAME}.exe ${BINARY_NAME}-windows.exe
echo "ASSET=${BINARY_NAME}-windows.exe" >> $GITHUB_ENV
elif [ "${{ runner.os }}" = "macOS" ]; then
mv target/release/${BINARY_NAME} ${BINARY_NAME}-macos
echo "ASSET=${BINARY_NAME}-macos" >> $GITHUB_ENV
else
mv target/release/${BINARY_NAME} ${BINARY_NAME}-linux
echo "ASSET=${BINARY_NAME}-linux" >> $GITHUB_ENV
fi
shell: bash
# Upload the binary as a release asset
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: ${{ env.ASSET }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}