-
-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (48 loc) · 1.31 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
# Trigger a release when a tag is pushed that starts with v then some number.
on:
push:
tags:
- 'v[0-9]+.*'
name: Release
jobs:
release:
name: Release
runs-on: ${{ matrix.os }}
permissions:
contents: write # Needed for creating releases
strategy:
matrix:
include:
- build: linux
os: ubuntu-22.04
target: x86_64-unknown-linux-musl
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
- name: Extract release notes
shell: bash
run: |
awk "/# Version ${GITHUB_REF_NAME#v}/{flag=1; next} /^$/{flag=0} flag" RELEASE_NOTES.md >REL.md
- name: Build release binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
- name: Create tarballs (Unix)
if: matrix.build == 'linux'
run: |
n="cackle-${{ github.ref_name }}-${{ matrix.target }}"
mkdir "$n"
cp "target/${{ matrix.target }}/release/cargo-acl" "$n"
tar zcf $n.tar.gz $n
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: REL.md
files: |
cackle-v*.*