diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 253dd71e..4aaadd68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,7 @@ jobs: with: node-version: '20' check-latest: true + registry-url: 'https://registry.npmjs.org' - name: Setup toolchain run: | @@ -119,6 +120,7 @@ jobs: with: name: v86 path: | + package.json build/libv86*.js build/libv86*.js.map build/v86*.wasm @@ -147,6 +149,16 @@ jobs: - name: Display structure of downloaded files run: ls -R + - name: Set package.json version + uses: actions/github-script@v7 + with: + result-encoding: string + script: | + const fs = require("fs"); + const pkg = {...require("./build/package.json"), version: '0.' + String(process.env.GITHUB_RUN_NUMBER)} + console.log(pkg); + fs.writeFileSync("package.json", JSON.stringify(pkg, null, " "), "utf8"); + - name: Release to GitHub uses: ncipollo/release-action@v1 with: @@ -156,3 +168,5 @@ jobs: body: ${{ github.event.head_commit.message }} artifacts: "build/libv86*.js,build/libv86*.js.map,build/*.mjs,build/v86*.wasm" prerelease: true + + - run: npm publish --provenance --access public diff --git a/package.json b/package.json index f7f7aee3..0cc79d40 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,15 @@ { "name": "v86", "version": "0", - "license": "BSD-2-Clause" + "license": "BSD-2-Clause", + "description": "x86 PC emulator and x86-to-wasm JIT, running in the browser", + "homepage": "https://copy.sh/v86/", + "files": [ + "build/libv86*.js", + "build/libv86*.js.map", + "build/*.mjs", + "build/v86*.wasm" + ], + "main": "build/libv86.js", + "repository": "github:copy/v86" }