Repository navigation
70 lines (63 loc) · 2.52 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (63 loc) · 2.52 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
# .github/workflows/release.yml — builds the agent for every platform and attaches the binaries
# and SHA256SUMS to a GitHub Release. Push a tag `v<version>` matching package.json to trigger.
#
# The server's install scripts (linux.sh, macos.sh, windows.ps1) download
# https://github.com/NetIgnite-project/Agent-Linux/releases/download/<tag>/netignite-agent-<os>-<arch>[.exe]
# and check it against SHA256SUMS from the same release, so the asset names are fixed.
# Versions with a suffix (1.0.0-beta.1) become pre-releases, which `latest` skips.
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- name: Check the tag against package.json
id: version
run: |
version="$(bun -e 'console.log(require("./package.json").version)')"
if [ "$GITHUB_REF_NAME" != "v$version" ]; then
echo "::error::Tag $GITHUB_REF_NAME doesn't match package.json version $version (the binaries report package.json's)."
exit 1
fi
case "$version" in
*-*) echo "prerelease=true" >> "$GITHUB_OUTPUT" ;;
*) echo "prerelease=false" >> "$GITHUB_OUTPUT" ;;
esac
- run: bun run check:ci
- run: bun run typecheck
- run: bun test
- run: bun run compile all --no-version-tag
- name: Collect the assets and SHA256SUMS
run: |
mkdir -p dist
for file in netignite-agent-linux-x64 netignite-agent-linux-x64-baseline netignite-agent-linux-arm64 \
netignite-agent-macos-x64 netignite-agent-macos-arm64 netignite-agent-windows-x64.exe; do
cp "build/bin/$file" "dist/$file"
done
./dist/netignite-agent-linux-x64 version
cd dist
sha256sum netignite-agent-* > SHA256SUMS
cat SHA256SUMS
- uses: softprops/action-gh-release@v2
with:
files: |
dist/netignite-agent-linux-x64
dist/netignite-agent-linux-x64-baseline
dist/netignite-agent-linux-arm64
dist/netignite-agent-macos-x64
dist/netignite-agent-macos-arm64
dist/netignite-agent-windows-x64.exe
dist/SHA256SUMS
fail_on_unmatched_files: true
generate_release_notes: true
prerelease: ${{ steps.version.outputs.prerelease }}