-
Notifications
You must be signed in to change notification settings - Fork 13
85 lines (71 loc) · 2.8 KB
/
Copy pathrelease.yml
File metadata and controls
85 lines (71 loc) · 2.8 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:
release:
types: [published]
permissions:
contents: write
id-token: write
attestations: write
jobs:
build-linux:
uses: ./.github/workflows/build-linux.yml
build-windows:
uses: ./.github/workflows/build-windows.yml
publish:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: nextclientapi_amxx-windows-Release
path: dist/windows
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: nextclientapi_amxx-linux-Release
path: dist/linux
- name: Package release archives
env:
TAG: ${{ github.event.release.tag_name }}
run: |
set -euo pipefail
dll=$(find dist/windows -name 'nextclientapi_amxx.dll' | head -n1)
so=$( find dist/linux -name 'nextclientapi_amxx_i386.so' | head -n1)
for f in "$dll" "$so"; do
[ -n "$f" ] && [ -f "$f" ] || { echo "::error::missing build output: '$f'"; exit 1; }
done
# Lay out the AMXX payload: module binary + scripting include + RSA public keys.
stage_common() {
root="$1"
mkdir -p "$root/addons/amxmodx/modules" \
"$root/addons/amxmodx/scripting/include" \
"$root/addons/amxmodx/data/nextclient_api/pkeys"
cp addons/amxmodx/scripting/include/next_client_api.inc \
"$root/addons/amxmodx/scripting/include/"
cp -r addons/amxmodx/data/nextclient_api/pkeys/. \
"$root/addons/amxmodx/data/nextclient_api/pkeys/"
}
stage_common stage/windows
cp "$dll" stage/windows/addons/amxmodx/modules/
(cd stage/windows && zip -r "$GITHUB_WORKSPACE/NextClientServerApi-$TAG-windows-win32.zip" addons)
stage_common stage/linux
cp "$so" stage/linux/addons/amxmodx/modules/
(cd stage/linux && zip -r "$GITHUB_WORKSPACE/NextClientServerApi-$TAG-linux-i386.zip" addons)
- name: Attest build provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: |
NextClientServerApi-${{ github.event.release.tag_name }}-windows-win32.zip
NextClientServerApi-${{ github.event.release.tag_name }}-linux-i386.zip
- name: Upload assets to release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.release.tag_name }}
run: >
gh release upload "$TAG"
"NextClientServerApi-$TAG-windows-win32.zip"
"NextClientServerApi-$TAG-linux-i386.zip"
--clobber --repo "$GITHUB_REPOSITORY"