Skip to content

Commit

Permalink
⚗️ Test publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Jan 9, 2025
1 parent 3410f32 commit dc6ccf9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 9 additions & 3 deletions scripts/build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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("sh", ['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})
})()

0 comments on commit dc6ccf9

Please sign in to comment.