-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (58 loc) · 1.88 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (58 loc) · 1.88 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
name: Rust release
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-14
target: aarch64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build CLI with committed embedded assets
run: cargo build --locked --release -p scone-cli --target ${{ matrix.target }}
- name: Package CLI and C API declaration
env:
RELEASE_TARGET: ${{ matrix.target }}
run: |
STAGE="scone-${GITHUB_SHA:0:12}-${RELEASE_TARGET}"
mkdir -p "$STAGE"
cp "target/$RELEASE_TARGET/release/scone" "$STAGE/"
cp LICENSE CITATION.cff README.md "$STAGE/"
cp crates/scone-ffi/include/scone.h "$STAGE/"
printf '%s\n' 'This archive contains the scone CLI and the C API header.' 'It does not include a compiled FFI library. Build one from this source revision with cargo build --locked --release -p scone-ffi.' > "$STAGE/ARTIFACTS.txt"
tar czf "$STAGE.tar.gz" "$STAGE"
- uses: actions/upload-artifact@v4
with:
name: scone-${{ matrix.target }}
path: scone-*.tar.gz
if-no-files-found: error
publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: scone-*
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: scone-*.tar.gz