-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (94 loc) · 3.06 KB
/
Copy pathrelease.yml
File metadata and controls
109 lines (94 loc) · 3.06 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
env:
# GitHub Actions runner Node 20 -> Node 24 deprecation (effective 2026-06-02).
# Forces JS-based actions onto Node 24 ahead of the cutover.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
name: build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Build React UI (populates ./dist for include_dir!)
run: npm run build
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Build wrapper binary
run: cargo build --release --target ${{ matrix.target }} -p animus-web-ui
- name: Package release tarball
run: |
set -euo pipefail
BIN=animus-web-ui
ARCHIVE="${BIN}-${{ matrix.target }}.tar.gz"
STAGE="dist-release/stage"
mkdir -p "${STAGE}"
cp "target/${{ matrix.target }}/release/${BIN}" "${STAGE}/"
cp wrapper/plugin.toml "${STAGE}/"
cp wrapper/README.md "${STAGE}/"
cp LICENSE "${STAGE}/"
mkdir -p dist-release
tar -C "${STAGE}" -czf "dist-release/${ARCHIVE}" .
( cd dist-release && shasum -a 256 "${ARCHIVE}" > "${ARCHIVE}.sha256" )
rm -rf "${STAGE}"
- name: Install cosign
uses: sigstore/cosign-installer@v3.7.0
- name: Sign archive with cosign (keyless)
run: |
set -euo pipefail
BIN=animus-web-ui
ARCHIVE="${BIN}-${{ matrix.target }}.tar.gz"
cd dist-release
cosign sign-blob \
--yes \
--bundle "${ARCHIVE}.bundle" \
"${ARCHIVE}"
- name: Upload per-target artifacts
uses: actions/upload-artifact@v4
with:
name: animus-web-ui-${{ matrix.target }}
path: |
dist-release/animus-web-ui-${{ matrix.target }}.tar.gz
dist-release/animus-web-ui-${{ matrix.target }}.tar.gz.sha256
dist-release/animus-web-ui-${{ matrix.target }}.tar.gz.bundle
release:
name: Publish GitHub release
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
path: dist-release
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: |
dist-release/animus-web-ui-*.tar.gz
dist-release/animus-web-ui-*.tar.gz.sha256
dist-release/animus-web-ui-*.tar.gz.bundle
generate_release_notes: true