-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (63 loc) · 1.89 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
# 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@v1
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-20.04
rustc-target: "x86_64-unknown-linux-gnu"
binary-suffix: "linux_amd64"
- runner-os: ubuntu-20.04
rustc-target: "aarch64-unknown-linux-gnu"
binary-suffix: "linux_arm64"
- runner-os: macos-11
rustc-target: "x86_64-apple-darwin"
binary-suffix: "darwin_amd64"
- runner-os: macos-11
rustc-target: "aarch64-apple-darwin"
binary-suffix: "darwin_arm64"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.rustc-target }}
override: true
profile: minimal
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: "--release"
- name: Create tarball
run: |
mkdir out
cp target/release/cmgr-artifact-server out/
cp README.md LICENSE.md 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@v1
with:
files: out/*.tar.gz