diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index cc01611..1d11cc5 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -35,7 +35,8 @@ jobs: - name: Install dependencies if: runner.os == 'Windows' run: | - pacman -Sy --noconfirm mingw-w64-x86_64-nodejs + pacman -Sy --noconfirm mingw-w64-x86_64-nodejs mingw-w64-x86_64-gcc \ + make - uses: actions/setup-node@v4 if: runner.os != 'Windows' with: @@ -55,12 +56,24 @@ jobs: publish: runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') + needs: + - build steps: + - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: pattern: artifact-* merge-multiple: true path: prebuilds + - uses: actions/setup-node@v4 + with: + node-version: latest + registry-url: https://registry.npmjs.org + cache: 'npm' + - name: Build + run: | + npm install + npm pack - uses: softprops/action-gh-release@v2 with: files: '*.tgz' diff --git a/package.json b/package.json index 43391bd..31159f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmake-build-system", - "version": "2.9.7", + "version": "2.9.5", "description": "A cross-platform build utility based on Lua", "repository": "https://github.com/xmake-io/xmake-wheel", "homepage": "https://github.com/xmake-io/xmake-wheel#readme", diff --git a/scripts/build.cjs b/scripts/build.cjs index 07f0e47..54e14bf 100755 --- a/scripts/build.cjs +++ b/scripts/build.cjs @@ -28,15 +28,21 @@ async function download(url, file) { }); } +function run(...args) { + const cmd = spawnSync(...args); + console.log(cmd.stdout.toString()) + console.error(cmd.stderr.toString()) +} + (async () => { if (!fs.existsSync(file)) await download(url, file) if (!fs.existsSync(cwd)) await tar.x({file: file, C: '.'}) if (!fs.existsSync(resolve(cwd, 'makefile'))) - spawnSync("./configure", [`--prefix=${prefix}`], {cwd: cwd}) + run("./configure", [`--prefix=${prefix}`], {cwd: cwd}) if (!fs.existsSync(resolve(cwd, 'build'))) - spawnSync("make", {cwd: cwd}) + run("make", {cwd: cwd}) if (!fs.existsSync(resolve(prefix, 'bin', 'xmake'))) - spawnSync("make", ["install"], {cwd: cwd}) + run("make", ["install"], {cwd: cwd}) })()