-
Notifications
You must be signed in to change notification settings - Fork 3
147 lines (128 loc) · 4.74 KB
/
Copy pathbuild.yml
File metadata and controls
147 lines (128 loc) · 4.74 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build libnode
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
fail-fast: false
matrix:
arch: [x64]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Locate VS Installer vs_installer.exe
if: runner.os == 'Windows'
id: vsinst
shell: pwsh
run: |
$bootstrap = Join-Path $env:RUNNER_TEMP 'vs_enterprise.exe'
Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vs_enterprise.exe' -OutFile $bootstrap
echo "cmd=$bootstrap" >> $env:GITHUB_OUTPUT
echo "op=install" >> $env:GITHUB_OUTPUT
- name: Get VS installation path
if: runner.os == 'Windows'
id: vs
shell: pwsh
run: |
$path = vswhere -latest -products * -property installationPath
if (-not $path) { throw "vswhere could not find Visual Studio" }
echo "path=$path" >> $env:GITHUB_OUTPUT
- name: Install MSVC 14.36.32532
if: runner.os == 'Windows'
shell: pwsh
run: |
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "${{ steps.vsinst.outputs.cmd }}"
$startInfo.Arguments = 'modify --installPath "${{ steps.vs.outputs.path }}" --add Microsoft.VisualStudio.Component.VC.14.36.17.6.x86.x64 --quiet --norestart --wait --noUpdateInstaller'
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$process.Start()
$process.WaitForExit()
- name: Verify MSVC 14.36 & list Auxiliary\Build
if: runner.os == 'Windows'
shell: pwsh
run: |
# Verify the installation
$path = Join-Path '${{ steps.vs.outputs.path }}' 'VC\Auxiliary\Build'
if (-not (Test-Path $path)) { throw "MSVC 14.36 not found" }
# List the contents of the Auxiliary\Build folder
Write-Host "`n=== Contents of $path ==="
Get-ChildItem -Path $path -Recurse -Force -ErrorAction SilentlyContinue |
ForEach-Object { Write-Host $_.FullName }
- name: Ensure MSVC Toolset 14.36.32532 is installed
if: runner.os == 'Windows'
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
toolset: 14.36.32532
- name: Setup alpine
uses: jirutka/setup-alpine@v1
if: runner.os != 'Windows'
with:
branch: v3.16
packages: >
git bash binutils-gold curl gnupg libgcc linux-headers make python3 ccache xz libatomic
clang clang-dev clang-libs llvm13-dev lld
libc-dev musl musl-dev musl-dbg gcc g++
- name: Apply all patches
shell: bash
working-directory: ./node
run: |
for f in ../patches/*.patch; do
echo "Applying $f..."
git apply --reject --whitespace=fix "$f"
done
- name: Build project
if: runner.os != 'Windows'
working-directory: ./node
shell: alpine.sh {0}
run: |
export CC="clang"
export CXX="clang++"
export CXXFLAGS="-g -mssse3 -std=c++20"
export LDFLAGS="-m64 -lstdc++ -Wl,--build-id -fuse-ld=lld"
./configure --shared
make -j4
- name: Install NASM
uses: ilammy/setup-nasm@v1
if: runner.os == 'Windows'
- name: Build
if: runner.os == 'Windows'
shell: bash
working-directory: ./node
run: ./vcbuild.bat release x64 dll no-cctest clang-cl
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: libnode-${{ runner.os }}-${{ matrix.arch }}
path: ./node/out/Release
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ github.workspace }}/libnode-Windows-x64/libnode22.dll
${{ github.workspace }}/libnode-Windows-x64/libnode22.lib
${{ github.workspace }}/libnode-Windows-x64/libnode22.pdb
${{ github.workspace }}/libnode-Windows-x64/libuv.dll
${{ github.workspace }}/libnode-Windows-x64/libuv.lib
${{ github.workspace }}/libnode-Windows-x64/libuv.pdb
${{ github.workspace }}/libnode-Linux-x64/libnode22.so
${{ github.workspace }}/libnode-Linux-x64/libuv.so
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: libnode-*