From 54ffd647df60c4421898a67b87bf2e25ca4af6a1 Mon Sep 17 00:00:00 2001 From: Jack Kleeman Date: Wed, 25 Oct 2023 21:44:09 +0100 Subject: [PATCH] Move to npm public package --- .github/workflows/publish.yml | 8 ++++---- .github/workflows/test.yml | 5 +++-- .npmrc | 2 -- package.json | 10 +++++++++- 4 files changed, 16 insertions(+), 9 deletions(-) delete mode 100644 .npmrc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 68a07cde..b3637de1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish package to GitHub Packages +name: Publish package to NPM on: release: types: [published] @@ -14,10 +14,10 @@ jobs: - uses: actions/setup-node@v3 with: node-version: "16.x" - registry-url: "https://npm.pkg.github.com" + registry-url: 'https://registry.npmjs.org' - run: npm ci - run: npm run proto - run: npm run build - - run: npm publish --tag latest + - run: npm publish --tag latest --access public env: - NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e732cd07..db07266c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' - run: npm ci - run: npm run proto - run: npm run verify @@ -36,7 +37,7 @@ jobs: - name: Publish snapshot if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} env: - NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | # We're using 0.0.0 to avoid this version to be higher than released versions. # To use it: @@ -45,7 +46,7 @@ jobs: # We use dist-tag dev for the snapshot releases, see https://docs.npmjs.com/cli/v9/commands/npm-dist-tag for more info # A snapshot MUST not be published with latest tag (omitting --tag defaults to latest) to avoid users to install snapshot releases # when using npm install - npm publish --tag dev + npm publish --tag dev --access public e2e: permissions: diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 9e53c381..00000000 --- a/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -@restatedev:registry=https://npm.pkg.github.com/ -//npm.pkg.github.com/:_authToken=${NPM_TOKEN} diff --git a/package.json b/package.json index edc69ebb..4ef980e7 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ } }, "publishConfig": { - "@restatedev:registry": "https://npm.pkg.github.com" + "@restatedev:registry": "https://registry.npmjs.org" }, "type": "commonjs", "main": "dist/public_api.js", @@ -63,5 +63,13 @@ "ts-node-dev": "^2.0.0", "typescript": "^4.9.5", "express": "*" + }, + "bugs": { + "url": "https://github.com/restatedev/sdk-typescript/issues" + }, + "homepage": "https://github.com/restatedev/sdk-typescript#readme", + "directories": { + "example": "examples", + "test": "test" } }