From d2f1dcbdf4376277a6c54432981ccd89c1bcceed Mon Sep 17 00:00:00 2001 From: Mostafa Soufi Date: Sun, 18 Sep 2022 13:07:44 +0430 Subject: [PATCH] Update npm-publish.yml --- .github/workflows/npm-publish.yml | 33 ++++++++++++------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 566c29a..dd01de2 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -10,27 +10,20 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to GitHub Packages + - uses: actions/setup-node@v3 with: - node-version: 15 + node-version: '16.x' + registry-url: 'https://npm.pkg.github.com' + # Defaults to the user or organization that owns the workflow file + scope: '@octocat' - run: npm ci - - run: npm test - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 15 - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: npm publish --access public + - run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - token: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}