-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (86 loc) · 2.44 KB
/
release.yml
File metadata and controls
92 lines (86 loc) · 2.44 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: specl
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: specl
- run: cargo fmt --check
- run: cargo clippy --workspace -- -D warnings -A clippy::too_many_arguments
- run: cargo test --workspace --exclude specl-tla
- run: cargo test -p specl-tla --test translate_corpus -- --skip benchmark_tla_files_translate
build:
needs: test
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: specl
key: release-${{ matrix.target }}
- name: Build
run: cargo build --release -p specl-cli
working-directory: specl
- name: Package
run: |
TAG="${GITHUB_REF#refs/tags/}"
ARCHIVE="specl-${TAG}-${{ matrix.target }}.tar.gz"
mkdir staging
cp specl/target/release/specl staging/
cp LICENSE staging/
tar -czf "$ARCHIVE" -C staging .
echo "ARCHIVE=$ARCHIVE" >> "$GITHUB_ENV"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.target }}
path: ${{ env.ARCHIVE }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install git-cliff
run: cargo install git-cliff --locked
- name: Generate changelog
run: |
git cliff --latest --strip header > RELEASE_NOTES.md
working-directory: specl
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@v2
with:
body_path: specl/RELEASE_NOTES.md
files: artifacts/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}