-
-
Notifications
You must be signed in to change notification settings - Fork 199
61 lines (58 loc) · 1.92 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
name: Publish
on:
push:
tags:
- "*.*.*"
jobs:
publish:
name: Publish for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: oha
release_name: oha-linux-amd64
target: x86_64-unknown-linux-musl
- os: windows-latest
artifact_name: oha.exe
release_name: oha-windows-amd64.exe
target: x86_64-pc-windows-msvc
- os: macos-latest
artifact_name: oha
release_name: oha-macos-amd64
target: x86_64-apple-darwin
- os: ubuntu-latest
artifact_name: oha
release_name: oha-linux-arm64
target: aarch64-unknown-linux-musl
- os: macos-latest
artifact_name: oha
release_name: oha-macos-arm64
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v1
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }} --locked --no-default-features --features rustls
- uses: svenstaro/upx-action@v2
if: matrix.target != 'aarch64-unknown-linux-musl' && matrix.target != 'aarch64-apple-darwin'
with:
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.release_name }}
tag: ${{ github.ref }}