-
-
Notifications
You must be signed in to change notification settings - Fork 47
67 lines (62 loc) · 1.92 KB
/
Copy pathnative-release.yml
File metadata and controls
67 lines (62 loc) · 1.92 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
name: Native release (alerts)
# Builds the nocturne_alerts cdylib (crates/nocturne-alerts-ffi) for linux-x64
# and win-x64 on a tag push like `alerts-v0.1.0` and attaches the artifacts to
# the GitHub release for that tag (creating the release if it doesn't exist).
on:
push:
tags: ["alerts-v*"]
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
artifact: libnocturne_alerts.so
asset: libnocturne_alerts-linux-x64.so
- os: windows-latest
rid: win-x64
artifact: nocturne_alerts.dll
asset: nocturne_alerts-win-x64.dll
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
crates/target
key: cargo-release-${{ runner.os }}-${{ hashFiles('crates/Cargo.lock') }}
- name: Build cdylib
working-directory: crates
run: cargo build --release -p nocturne-alerts-ffi
- name: Stage artifact under its release asset name
shell: bash
run: |
mkdir -p dist
cp "crates/target/release/${{ matrix.artifact }}" "dist/${{ matrix.asset }}"
- uses: actions/upload-artifact@v4
with:
name: nocturne-alerts-${{ matrix.rid }}
path: dist/${{ matrix.asset }}
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Attach artifacts to the GitHub release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true