1111 required : false
1212 type : string
1313
14+ permissions :
15+ contents : write
16+ id-token : write
17+ attestations : write
18+
1419jobs :
1520 create_release :
1621 name : Create Release
3035 uses : actions/setup-node@v6
3136 with :
3237 node-version : 24.13.0
38+ cache : ' npm'
3339
3440 - name : Get Package Version
3541 id : package-version
@@ -50,11 +56,32 @@ jobs:
5056 name : Release ${{ steps.package-version.outputs.version }}
5157
5258 build :
53- name : Build
59+ name : Build (${{ matrix.target }})
5460 needs : create_release
5561 strategy :
62+ fail-fast : false
5663 matrix :
57- os : [ubuntu-22.04, windows-2022, macos-26]
64+ include :
65+ - target : windows-x64
66+ os : windows-2022
67+ node_arch : x64
68+ archflags : ' '
69+ - target : linux-x64
70+ os : ubuntu-22.04
71+ node_arch : x64
72+ archflags : ' '
73+ - target : linux-arm64
74+ os : ubuntu-22.04-arm
75+ node_arch : arm64
76+ archflags : ' '
77+ - target : darwin-x64
78+ os : macos-26
79+ node_arch : x64
80+ archflags : ' -arch x86_64'
81+ - target : darwin-arm64
82+ os : macos-26
83+ node_arch : arm64
84+ archflags : ' -arch arm64'
5885
5986 runs-on : ${{ matrix.os }}
6087
@@ -69,13 +96,29 @@ jobs:
6996 uses : actions/setup-node@v6
7097 with :
7198 node-version : 24.13.0
99+ architecture : ${{ matrix.node_arch }}
100+ cache : ' npm'
101+
102+ - name : Print Native Target
103+ run : |
104+ echo "runner=$(uname -s)-$(uname -m)"
105+ node -p "'node=' + process.version + ' platform=' + process.platform + ' arch=' + process.arch"
106+ npm config get arch
107+
108+ - name : Cache Steamworks SDK
109+ uses : actions/cache@v4
110+ with :
111+ path : .sdk
112+ key : steamworks-sdk-${{ secrets.STEAM_SDK_GZ_SHA }}
72113
73114 - name : Install Modules
74- run : npm install --ignore-scripts
115+ run : npm ci --ignore-scripts
75116
76117 - name : Build Current Binary
77118 run : npm run build:rebuild
78119 env :
120+ npm_config_arch : ${{ matrix.node_arch }}
121+ ARCHFLAGS : ${{ matrix.archflags }}
79122 STEAM_SDK_GZ_LINK : ${{ secrets.STEAM_SDK_GZ_LINK }}
80123 STEAM_SDK_GZ_SHA : ${{ secrets.STEAM_SDK_GZ_SHA }}
81124
@@ -92,6 +135,11 @@ jobs:
92135 id : pack-files
93136 run : node -e "import('@node-3d/addon-tools').then((m) => m.actionPack())" >> $GITHUB_OUTPUT
94137
138+ - name : Attest Binary
139+ uses : actions/attest@v4
140+ with :
141+ subject-path : ${{ steps.pack-files.outputs.pack }}
142+
95143 - name : Store Binaries
96144 uses : softprops/action-gh-release@v3
97145 env :
0 commit comments