-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.76 KB
/
Copy pathrelease.yml
File metadata and controls
61 lines (52 loc) · 1.76 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number (e.g., 1.0.0)'
required: true
default: '1.0.0'
permissions:
contents: write
jobs:
build-and-upload:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: agent-switch.exe
asset_name: agent-switch-windows-x86_64.exe
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: agent-switch
asset_name: agent-switch-linux-x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: agent-switch
asset_name: agent-switch-macos-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libvulkan-dev libwayland-dev xorg-dev
- name: Build Release
run: cargo build --release --target ${{ matrix.target }}
- name: Rename Artifact
shell: bash
run: mv target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ./${{ matrix.asset_name }}
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Release v${{ github.event.inputs.version }}
tag_name: v${{ github.event.inputs.version }}
files: ./${{ matrix.asset_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}