-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.66 KB
/
release.yml
File metadata and controls
85 lines (70 loc) · 2.66 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
test:
name: Gate Tests
runs-on: ubuntu-latest
container: gnuoctave/octave:11.1.0
steps:
- uses: actions/checkout@v6
- name: Build MEX and run tests
env:
FASTSENSE_SKIP_BUILD: "1"
run: |
octave --eval "install();"
xvfb-run octave --eval "install(); cd('tests'); r = run_all_tests(); if r.failed > 0; exit(1); end"
release:
name: Create Release
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
- name: Generate changelog
id: changelog
run: |
PREV_TAG=$(git tag --sort=-v:refname | head -n 2 | tail -n 1)
if [ -z "$PREV_TAG" ] || [ "$PREV_TAG" = "${GITHUB_REF_NAME}" ]; then
CHANGELOG=$(git log --no-merges --pretty=format:"- %s (%h)" --max-count=50 HEAD)
else
CHANGELOG=$(git log --no-merges --pretty=format:"- %s (%h)" "${PREV_TAG}..HEAD")
fi
echo "CHANGELOG<<EOF" >> "$GITHUB_OUTPUT"
echo "$CHANGELOG" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Package release
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
DIRNAME="FastSense-${VERSION}"
mkdir -p "${DIRNAME}"
# Copy release contents (allowlist — excludes tests/, benchmarks/, docs/, bridge/, private/, .git/)
cp install.m LICENSE README.md CITATION.cff "${DIRNAME}/"
cp -r examples "${DIRNAME}/"
# Copy libs including committed prebuilt MEX binaries.
# Binaries are refreshed by .github/workflows/refresh-mex-binaries.yml
# and shipped in the release archive so end users skip compilation.
cp -r libs "${DIRNAME}/"
# Create archives
tar czf "${DIRNAME}.tar.gz" "${DIRNAME}"
zip -r "${DIRNAME}.zip" "${DIRNAME}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
name: ${{ steps.version.outputs.VERSION }}
body: |
## What's Changed
${{ steps.changelog.outputs.CHANGELOG }}
## Installation
Download the archive, extract it, and run `install` in MATLAB/Octave. Prebuilt MEX binaries are bundled — compilation only happens on unsupported platforms.
files: |
FastSense-${{ steps.version.outputs.VERSION }}.tar.gz
FastSense-${{ steps.version.outputs.VERSION }}.zip