From 17a2cce845f66785fc34f0fdfd9667116728499f Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 25 Jan 2024 11:00:10 +0000 Subject: [PATCH] chore: publish main package --- .github/workflows/builds.yml | 33 ++- homestar-runtime/npm/base/package-lock.json | 263 ------------------ .../package.json => package-json-base.tmpl} | 17 +- 3 files changed, 37 insertions(+), 276 deletions(-) delete mode 100644 homestar-runtime/npm/base/package-lock.json rename homestar-runtime/npm/{base/package.json => package-json-base.tmpl} (61%) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index a459795f..f0feb90e 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -132,7 +132,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - registry-url: "https://registry.npmjs.org" + registry-url: 'https://registry.npmjs.org' - name: Install cargo get run: cargo install cargo-get - name: Prepare os/arch packages @@ -151,16 +151,17 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ matrix.target }} - path: "homestar-runtime/npm/${{ env.node_pkg }}/bin" - - name: Publish production + path: 'homestar-runtime/npm/${{ env.node_pkg }}/bin' + - name: Publish arch packages to production if: github.event_name == 'release' && github.event.action == 'published' run: | cp homestar-runtime/README.md "homestar-runtime/npm/${{ env.node_pkg }}" cd "homestar-runtime/npm/${{ env.node_pkg }}" + chmod +x bin/${{ matrix.bin }} npm publish --access=public env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - name: Publish RC + - name: Publish arch packages RC if: github.event_name == 'workflow_dispatch' run: | cp homestar-runtime/README.md "homestar-runtime/npm/${{ env.node_pkg }}" @@ -170,6 +171,28 @@ jobs: npm publish --access public --tag rc env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + - name: Publish main package to production + if: github.event_name == 'release' && github.event.action == 'published' + run: | + cp homestar-runtime/README.md "homestar-runtime/npm/base" + cd homestar-runtime/npm + export node_version=$(cargo get workspace.package.version) + envsubst < package-json-base.tmpl > "base/package.json" + cd base + npm publish --access=public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + - name: Publish main package RC + if: github.event_name == 'workflow_dispatch' + run: | + cp homestar-runtime/README.md "homestar-runtime/npm/base" + cd homestar-runtime/npm + export node_version="$(cargo get workspace.package.version)-rc.$(date +%s)" + envsubst < package-json-base.tmpl > "base/package.json" + cd base + npm publish --access public --tag rc + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} build-packages: needs: binary-builds @@ -243,7 +266,7 @@ jobs: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-publish) runs-on: ubuntu-latest env: - DOCKER_BUILDKIT: "1" + DOCKER_BUILDKIT: '1' REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} diff --git a/homestar-runtime/npm/base/package-lock.json b/homestar-runtime/npm/base/package-lock.json deleted file mode 100644 index dcf9b431..00000000 --- a/homestar-runtime/npm/base/package-lock.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "name": "homestar-runtime", - "version": "0.0.8", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "homestar-runtime", - "version": "0.0.8", - "license": "MIT", - "dependencies": { - "execa": "^8.0.1" - }, - "bin": { - "homestar": "index.js" - }, - "optionalDependencies": { - "homestar-darwin-arm64": "*", - "homestar-darwin-x64": "*", - "homestar-linux-arm64": "*", - "homestar-linux-x64": "*", - "homestar-windows-arm64": "*", - "homestar-windows-x64": "*" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/homestar-darwin-arm64": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/homestar-darwin-arm64/-/homestar-darwin-arm64-0.0.1.tgz", - "integrity": "sha512-ftcZyXJalctBtj3jhTepLVE6LjNaB/k2KB9zAAZjQi6neAKs+MMTqaRt8TV3/X16hOryOeyjDPCshgbGnqpBJw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/homestar-darwin-x64": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/homestar-darwin-x64/-/homestar-darwin-x64-0.0.1.tgz", - "integrity": "sha512-DT4H2XnKD6bwjY/3ooYRwfqnP8maKlLp53ZOkeSPIWT8HDf7DI/6WJxeZZy8AGkMox5SU0xP64CrIQ3W/D57NA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/homestar-linux-arm64": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/homestar-linux-arm64/-/homestar-linux-arm64-0.0.1.tgz", - "integrity": "sha512-IKDrLIvZWmp1ZrcYyySV1xp7wOYOCHPELeuiOEd0a3YuHssURXS4CdibUGKXGnTnxv7w7bjNla5HAVyOnC/dNA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/homestar-linux-x64": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/homestar-linux-x64/-/homestar-linux-x64-0.0.1.tgz", - "integrity": "sha512-LuY2HA3SM1B5B4LFpyb+eAKHFaKlEJ0vtkr/aFJCR9d0SA/omf3ZpqmeT4zDrCNgCnqT81rvVDjBOP094890zw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" - }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - } - } -} diff --git a/homestar-runtime/npm/base/package.json b/homestar-runtime/npm/package-json-base.tmpl similarity index 61% rename from homestar-runtime/npm/base/package.json rename to homestar-runtime/npm/package-json-base.tmpl index d5a6669a..62fbc104 100644 --- a/homestar-runtime/npm/base/package.json +++ b/homestar-runtime/npm/package-json-base.tmpl @@ -1,8 +1,9 @@ { "name": "homestar-runtime", - "version": "0.0.8", + "version": "${node_version}", "description": "The IPVM reference implementation", - "author": "Hugo Dias (hugodias.me)", + "author": "Hugo Dias + (hugodias.me)", "homepage": "https://github.com/ipvm-wg/homestar/tree/main/homestar-runtime", "repository": { "url": "ipvm-wg/homestar", @@ -25,12 +26,12 @@ }, "license": "Apache-2.0", "optionalDependencies": { - "homestar-darwin-arm64": "*", - "homestar-darwin-x64": "*", - "homestar-linux-arm64": "*", - "homestar-linux-x64": "*", - "homestar-windows-arm64": "*", - "homestar-windows-x64": "*" + "homestar-darwin-arm64": "${node_version}", + "homestar-darwin-x64": "${node_version}", + "homestar-linux-arm64": "${node_version}", + "homestar-linux-x64": "${node_version}", + "homestar-windows-arm64": "${node_version}", + "homestar-windows-x64": "${node_version}" }, "dependencies": { "execa": "^8.0.1"