@@ -19,24 +19,24 @@ jobs:
1919 outputs :
2020 release_created : ${{ steps.release.outputs.release_created }}
2121 version : ${{ steps.package.outputs.version }}
22-
22+
2323 steps :
2424 - name : Checkout code
2525 uses : actions/checkout@v4
26-
26+
2727 - name : Synchronize Node.js binding version
2828 run : |
2929 echo "Synchronizing Node.js binding version with main project..."
3030 python3 scripts/sync_node_version.py
31-
31+
3232 - name : Get package version
3333 id : package
3434 working-directory : libCacheSim-node
3535 run : |
3636 VERSION=$(node -p "require('./package.json').version")
3737 echo "version=$VERSION" >> $GITHUB_OUTPUT
3838 echo "Version: $VERSION"
39-
39+
4040 - name : Check if release exists
4141 id : check_release
4242 run : |
5050 fi
5151 env :
5252 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53-
53+
5454 - name : Create GitHub Release
5555 id : release
5656 if : steps.check_release.outputs.exists == 'false'
@@ -62,15 +62,15 @@ jobs:
6262 release_name : Release v${{ steps.package.outputs.version }}
6363 body : |
6464 Release v${{ steps.package.outputs.version }}
65-
65+
6666 ## Installation
6767 ```bash
6868 npm install libcachesim-node
6969 ```
70-
70+
7171 ## Supported Platforms
7272 - Linux x64
73-
73+
7474 Pre-compiled binaries are automatically downloaded during installation.
7575 draft : false
7676 prerelease : false
@@ -79,48 +79,48 @@ jobs:
7979 if : github.event_name == 'release'
8080 needs : create-release
8181 runs-on : ubuntu-latest
82-
82+
8383 steps :
8484 - name : Checkout code
8585 uses : actions/checkout@v4
8686 with :
8787 fetch-depth : 0
88-
88+
8989 - name : Synchronize Node.js binding version
9090 run : |
9191 echo "Synchronizing Node.js binding version with main project..."
9292 python3 scripts/sync_node_version.py
93-
93+
9494 - name : Setup Node.js
9595 uses : actions/setup-node@v4
9696 with :
9797 node-version : ' 18'
9898 registry-url : ' https://registry.npmjs.org'
99-
99+
100100 - name : Install system dependencies
101101 run : |
102102 sudo apt-get update
103- sudo apt-get install -y build-essential cmake libglib2.0-dev libzstd-dev
104-
103+ sudo apt-get install -y build-essential cmake ninja-build libglib2.0-dev libzstd-dev
104+
105105 - name : Build libCacheSim
106106 run : |
107107 echo "Building libCacheSim for Linux x64..."
108108 mkdir -p _build
109109 cd _build
110- cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. -DCMAKE_VERBOSE_MAKEFILE=ON
110+ cmake -G Ninja - DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. -DCMAKE_VERBOSE_MAKEFILE=ON
111111 echo "Starting build..."
112- make -j$(nproc) VERBOSE=1
113-
112+ ninja -v
113+
114114 - name : Prepare vendored library
115115 run : |
116116 mkdir -p libCacheSim-node/vendor/include
117117 cp _build/liblibCacheSim.a libCacheSim-node/vendor/
118118 cp -r libCacheSim/include/* libCacheSim-node/vendor/include/
119-
119+
120120 - name : Install Node.js dependencies
121121 working-directory : libCacheSim-node
122122 run : npm install
123-
123+
124124 - name : Build and upload prebuilt binary
125125 working-directory : libCacheSim-node
126126 run : |
@@ -132,7 +132,7 @@ jobs:
132132 CFLAGS=-fPIC CXXFLAGS=-fPIC npx prebuild --upload-all --verbose
133133 env :
134134 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
135-
135+
136136 - name : Test binary
137137 working-directory : libCacheSim-node
138138 run : |
@@ -145,33 +145,33 @@ jobs:
145145 if : github.event_name == 'release'
146146 needs : build-and-publish
147147 runs-on : ubuntu-latest
148-
148+
149149 steps :
150150 - name : Checkout code
151151 uses : actions/checkout@v4
152-
152+
153153 - name : Synchronize Node.js binding version
154154 run : |
155155 echo "Synchronizing Node.js binding version with main project..."
156156 python3 scripts/sync_node_version.py
157-
157+
158158 - name : Setup Node.js
159159 uses : actions/setup-node@v4
160160 with :
161161 node-version : ' 18'
162162 registry-url : ' https://registry.npmjs.org'
163-
163+
164164 - name : Install system dependencies
165165 run : |
166166 sudo apt-get update
167- sudo apt-get install -y build-essential cmake libglib2.0-dev libzstd-dev
167+ sudo apt-get install -y build-essential cmake ninja-build libglib2.0-dev libzstd-dev
168168
169169 - name : Build libCacheSim
170170 run : |
171171 mkdir -p _build
172172 cd _build
173- cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ..
174- make -j$(nproc)
173+ cmake -G Ninja - DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ..
174+ ninja
175175
176176 - name : Prepare vendored library
177177 run : |
@@ -184,4 +184,4 @@ jobs:
184184 working-directory : libCacheSim-node
185185 run : npm publish --access public
186186 env :
187- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
187+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments