-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 2 KB
/
release.yaml
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
permissions:
contents: write
name: Release
on:
push:
tags:
- "v*"
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive-name: linux
archive-suffix: tar.gz
archive-cmd: tar czf
executable-suffix: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
archive-name: windows
archive-suffix: zip
archive-cmd: 7z a
executable-suffix: .exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cargo-about
run: cargo install cargo-about
- name: Build
run: cargo build --release
- name: Generate License
run: |
echo "accepted = ['Apache-2.0','MIT','BSD-3-Clause','Zlib','MPL-2.0','Unicode-DFS-2016','ISC','OpenSSL','OpenSSL-standalone','SSLeay-standalone','GPL-1.0','LicenseRef-scancode-public-domain','LicenseRef-scancode-unknown-license-reference']" > about.toml
cargo about init
cargo about generate about.hbs -o ThirdPartyLicenses.html
- name: Create Release Archive
shell: bash
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
REPO_NAME=${GITHUB_REPOSITORY##*/}
RELEASE_NAME="${REPO_NAME}-${TAG_NAME}-${{ matrix.archive-name }}"
mkdir -p "${RELEASE_NAME}"
cp "target/release/${REPO_NAME}${{ matrix.executable-suffix }}" "${RELEASE_NAME}/"
cp LICENSE README.md ThirdPartyLicenses.html "${RELEASE_NAME}/"
${{ matrix.archive-cmd }} "${RELEASE_NAME}.${{ matrix.archive-suffix }}" "${RELEASE_NAME}"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: "*.${{ matrix.archive-suffix }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}