-
-
Notifications
You must be signed in to change notification settings - Fork 73
72 lines (70 loc) · 2.39 KB
/
release.yml
File metadata and controls
72 lines (70 loc) · 2.39 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
name: Release CLI
on:
release:
types: [created]
jobs:
build:
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
include:
- name: Linux x64
runner: ubuntu-latest
target: x86_64-unknown-linux-musl
artifact: svg2gcode-linux-x86_64
- name: Linux arm64
runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
artifact: svg2gcode-linux-aarch64
- name: macOS x64
runner: macos-15-intel
target: x86_64-apple-darwin
artifact: svg2gcode-macos-x86_64
- name: macOS arm64
runner: macos-latest
target: aarch64-apple-darwin
artifact: svg2gcode-macos-aarch64
- name: Windows x64
runner: windows-latest
target: x86_64-pc-windows-msvc
artifact: svg2gcode-windows-x86_64.exe
- name: Windows arm64
runner: windows-11-arm
target: aarch64-pc-windows-msvc
artifact: svg2gcode-windows-aarch64.exe
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Install musl tools
if: contains(matrix.target, 'musl')
run: sudo apt-get install -y musl-tools
- name: Build
run: cargo build --release --target ${{ matrix.target }} -p svg2gcode-cli
- name: Copy cli build
run: cp target/${{ matrix.target }}/release/svg2gcode${{ runner.os == 'Windows' && '.exe' || '' }} ${{ matrix.artifact }}
- uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
release:
name: Upload release assets
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v7
with:
path: artifacts
merge-multiple: true
- name: Upload to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: gh release upload ${{ github.event.release.tag_name }} artifacts/*