-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.11 KB
/
build-release.yml
File metadata and controls
46 lines (38 loc) · 1.11 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
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-release:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Build release binary
run: cargo build --release
- name: Package binary (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p dist
cp target/release/maple dist/maple
tar -czf dist/maple-${{ runner.os }}.tar.gz -C dist maple
- name: Package binary (Windows)
if: runner.os == 'Windows'
run: |
New-Item -ItemType Directory -Force -Path dist | Out-Null
Copy-Item target\\release\\maple.exe dist\\maple.exe
Compress-Archive -Path dist\\maple.exe -DestinationPath dist\\maple-Windows.zip
shell: pwsh
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*