11name : Build Binaries
2+
3+ permissions :
4+ contents : write
5+ id-token : write
6+ attestations : write
7+
28defaults :
39 run :
410 shell : bash
@@ -15,12 +21,10 @@ jobs:
1521 create_release :
1622 name : Create Release
1723 runs-on : ubuntu-latest
18-
1924 outputs :
2025 upload_url : ${{ steps.create_release.outputs.upload_url }}
2126
2227 steps :
23-
2428 - name : Fetch Repository
2529 uses : actions/checkout@v7
2630 with :
@@ -51,15 +55,46 @@ jobs:
5155 name : Release ${{ steps.package-version.outputs.version }}
5256
5357 build :
54- name : Build
58+ name : Build ${{ matrix.target }}
59+ needs : create_release
5560 strategy :
56- matrix :
57- os : [ubuntu-22.04, ubuntu-22.04-arm, windows-2022, macos-26]
61+ fail-fast : false
62+ matrix :
63+ include :
64+ - target : windows-x64
65+ os : windows-2022
66+ node_arch : x64
67+ archflags : ' '
68+ vs_prerelease : false
69+ - target : windows-arm64
70+ os : windows-11-vs2026-arm
71+ node_arch : arm64
72+ archflags : ' '
73+ vs_prerelease : true
74+ - target : linux-x64
75+ os : ubuntu-22.04
76+ node_arch : x64
77+ archflags : ' '
78+ vs_prerelease : false
79+ - target : linux-arm64
80+ os : ubuntu-22.04-arm
81+ node_arch : arm64
82+ archflags : ' '
83+ vs_prerelease : false
84+ - target : darwin-x64
85+ os : macos-26
86+ node_arch : x64
87+ archflags : ' -arch x86_64'
88+ vs_prerelease : false
89+ - target : darwin-arm64
90+ os : macos-26
91+ node_arch : arm64
92+ archflags : ' -arch arm64'
93+ vs_prerelease : false
5894
5995 runs-on : ${{ matrix.os }}
6096
6197 steps :
62-
6398 - name : Fetch Repository
6499 uses : actions/checkout@v7
65100 with :
@@ -69,12 +104,22 @@ jobs:
69104 uses : actions/setup-node@v6
70105 with :
71106 node-version : 24.13.0
107+ architecture : ${{ matrix.node_arch }}
72108 cache : ' npm'
73109
110+ - name : Configure MSBuild
111+ if : startsWith(matrix.target, 'windows-')
112+ uses : microsoft/setup-msbuild@v3
113+ with :
114+ msbuild-architecture : ${{ matrix.node_arch }}
115+ vs-prerelease : ${{ matrix.vs_prerelease || false }}
116+
74117 - name : Install Modules
75118 run : npm ci
76119
77120 - name : Build Current Binary
121+ env :
122+ ARCHFLAGS : ${{ matrix.archflags }}
78123 run : npm run build:rebuild
79124
80125 - name : Get Package Version
@@ -88,7 +133,12 @@ jobs:
88133
89134 - name : Pack Files
90135 id : pack-files
91- run : node -e "import('@node-3d/addon-tools').then((m) => m.actionPack())" >> $GITHUB_OUTPUT
136+ run : node -e "import('@node-3d/addon-tools').then((m) => m.actionPack())" >> "$GITHUB_OUTPUT"
137+
138+ - name : Attest Binary Archive
139+ uses : actions/attest@v4
140+ with :
141+ subject-path : ${{ steps.pack-files.outputs.pack }}
92142
93143 - name : Store Binaries
94144 uses : softprops/action-gh-release@v3
0 commit comments