-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (74 loc) · 2.5 KB
/
release.yml
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
73
74
75
76
name: release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
release_build:
name: Build ${{ matrix.platform.os_name }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- os_name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-gnu
archiver: zip
archive_type: zip
bin: spritter.exe
- os_name: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archiver: tar
archive_type: tar.gz
bin: spritter
- os_name: MacOS-x86_64
os: macos-latest
target: x86_64-apple-darwin
archiver: tar
archive_type: tar.gz
bin: spritter
- os_name: MacOS-aarch64
os: macos-latest
target: aarch64-apple-darwin
archiver: tar
archive_type: tar.gz
bin: spritter
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Stable rust toolchain
run: rustup toolchain install stable --target ${{ matrix.platform.target }} --profile minimal
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "rust-stable"
shared-key: "release_build-${{ matrix.platform.target }}"
- name: Build
run: cargo build --target ${{ matrix.platform.target }} --release --package spritter
- name: Archive the built binary
uses: TheDoctor0/[email protected]
with:
type: ${{ matrix.platform.archiver }}
filename: spritter_${{ matrix.platform.target }}.${{ matrix.platform.archive_type }}
directory: ./target/${{ matrix.platform.target }}/release
path: ${{ matrix.platform.bin }}
- name: Upload release artifact for release job
uses: actions/upload-artifact@v4
with:
name: release_${{ matrix.platform.target }}
path: ./target/${{ matrix.platform.target }}/release/spritter_${{ matrix.platform.target }}.${{ matrix.platform.archive_type }}
create_release:
name: Create release
needs: release_build
runs-on: ubuntu-latest
steps:
- name: Download release artifacts from build job
uses: actions/download-artifact@v4
with:
path: ~/build_artifacts
- name: Create release
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: ~/build_artifacts/release_*/*