diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package-to-github.yml similarity index 91% rename from .github/workflows/release-package.yml rename to .github/workflows/release-package-to-github.yml index 5bbc34c..b3b821d 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package-to-github.yml @@ -1,4 +1,4 @@ -name: Node.js Package +name: Release Node.js Package on: push: @@ -33,8 +33,7 @@ jobs: ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version. - uses: actions/setup-node@v4 with: - node-version: 16 - registry-url: https://npm.pkg.github.com/ + registry-url: 'https://npm.pkg.github.com' - run: npm ci - run: npm publish env: diff --git a/.github/workflows/release-package-to-npm.yml b/.github/workflows/release-package-to-npm.yml new file mode 100644 index 0000000..be3f8fe --- /dev/null +++ b/.github/workflows/release-package-to-npm.yml @@ -0,0 +1,41 @@ +name: Release Node.js Package to NPM + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v4 + - name: Update local package.json version from release tag + uses: BellCubeDev/update-package-version-by-release-tag@v2 + with: + version: ${{ github.ref_name }} + keep-v: "false" # If set to "true", will not remove any 'v' prefix from the version number. + ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version. + - uses: actions/setup-node@v4 + with: + node-version: 16 + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish + env: + NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 06296f8..7b6bb30 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "egern" ], "license": "Apache-2.0", + "bugs": "https://github.com/NSNanoCat/util/issues", "main": "index.js", "type": "module", "scripts": { @@ -32,9 +33,6 @@ "gRPC.mjs", "getStorage.mjs" ], - "publishConfig": { - "@nsnanocat:registry": "https://npm.pkg.github.com" - }, "devDependencies": { "typescript": "^5.6.3" }