From 177a763305a39c9cfca73a9fcd61cbe6ab3a49e5 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Thu, 2 Jun 2022 16:14:42 +0300 Subject: [PATCH] ci: generate .npmrc --- .github/workflows/ci.yaml | 32 +++++++++++++++++++++++++++----- .gitignore | 3 +++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3d4242d..1c63f7e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,6 +28,9 @@ jobs: with: node-version: 18 + - name: Install deps + run: npm i + - name: Run tests run: npm run test @@ -50,6 +53,9 @@ jobs: with: node-version: ${{ matrix.node-version }} + - name: Install deps + run: npm i + - name: Run tests timeout-minutes: 1 run: npm run test @@ -60,25 +66,41 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/master' needs: test_push runs-on: ubuntu-20.04 + + permissions: + checks: read + statuses: write + contents: write + packages: write + steps: - name: Checkout uses: actions/checkout@v3 with: - persist-credentials: false + fetch-depth: 0 + ref: master - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: 18 + - name: Install deps + run: npm i + + - name: Create .npmrc + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc + echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> .npmrc + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Release env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - GH_USER: 'qiwibot' NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GIT_AUTHOR_EMAIL: 'opensource@qiwi.com' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GIT_COMMITTER_EMAIL: 'opensource@qiwi.com' - GIT_AUTHOR_NAME: '@qiwibot' GIT_COMMITTER_NAME: '@qiwibot' run: | npm link diff --git a/.gitignore b/.gitignore index 6704566..f530642 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,6 @@ dist # TernJS port file .tern-port + +# Creds +.npmrc \ No newline at end of file