-
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (74 loc) · 2.4 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
name: Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
env:
TAG: ${{ github.ref_name }}
REPO: ${{ github.repository }}
jobs:
create-release:
name: Create draft release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Generate release message
uses: orhun/git-cliff-action@v2
id: git-cliff
with:
config: cliff.toml
args: --current --strip all
- name: Create draft release
run: gh release create "$TAG" --verify-tag --draft --notes-file "${{ steps.git-cliff.outputs.changelog }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-assets:
name: Upload assets (${{ matrix.target }})
needs: create-release
strategy:
matrix:
include:
- { os: macos-latest, target: aarch64-apple-darwin }
- { os: macos-latest, target: x86_64-apple-darwin }
- { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, tools: binutils-aarch64-linux-gnu }
- { os: ubuntu-latest, target: aarch64-unknown-linux-musl, tools: binutils-aarch64-linux-gnu }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl }
- { os: windows-latest, target: aarch64-pc-windows-msvc }
- { os: windows-latest, target: x86_64-pc-windows-msvc }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install extra tools
if: ${{ matrix.tools != '' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ${{ matrix.tools }}
- name: Build and upload binary
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: wazzup
archive: $bin-$tag-$target
target: ${{ matrix.target }}
checksum: sha512
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-release:
name: Publish release
runs-on: ubuntu-latest
needs:
- create-release
- upload-assets
steps:
- name: Publish release
run: gh release edit --repo "$REPO" "$TAG" --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}