-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 1.79 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
# Builds binaries and uploads them to a GitHub release when a v* tag is pushed.
name: Publish release
on:
push:
tags:
- 'v*'
jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Create release
id: create-release
uses: softprops/action-gh-release@v2
build:
name: Build release binaries
runs-on: ${{ matrix.runner-os }}
needs: create-release
strategy:
matrix:
include:
# Match Go/cmgr convention for suffixes
- runner-os: ubuntu-latest
rustc-target: "x86_64-unknown-linux-gnu"
binary-suffix: "linux_amd64"
- runner-os: ubuntu-latest
rustc-target: "aarch64-unknown-linux-gnu"
binary-suffix: "linux_arm64"
- runner-os: macos-latest
rustc-target: "x86_64-apple-darwin"
binary-suffix: "darwin_amd64"
- runner-os: macos-latest
rustc-target: "aarch64-apple-darwin"
binary-suffix: "darwin_arm64"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rustc-target }}
- name: Build
run: |
cargo build --release
- name: Create tarball
run: |
mkdir out
cp target/release/cmgr-artifact-server out/
cp README.md LICENSE-APACHE LICENSE-MIT CHANGELOG.md out/
cd out && tar czf cmgr-artifact-server_${suffix}.tar.gz *
env:
suffix: ${{ matrix.binary-suffix }}
- name: Upload tarball
uses: softprops/action-gh-release@v2
with:
files: out/*.tar.gz