From 2c179baae98592baaf49d3911aab3efbee2accd4 Mon Sep 17 00:00:00 2001 From: Nikolay Kharitonov Date: Sat, 25 Nov 2023 18:24:57 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20add=20publish=20to=20npmjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/npm.yml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 4db481c..8f7ace1 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -1,21 +1,41 @@ name: Build npm package -on: push +on: + push: + branches: + - '**' jobs: build: - runs-on: ubuntu-20.04 + if: contains(github.event.head_commit.message, '๐Ÿ”–') + runs-on: ubuntu-latest permissions: contents: read packages: write steps: - - uses: actions/checkout@v3 + - name: โคต๏ธ Checkout + uses: actions/checkout@v3 # Setup .npmrc file to publish to GitHub Packages - - uses: actions/setup-node@v3 + - name: ๐Ÿ”จ Setup node (github registry) + uses: actions/setup-node@v3 with: node-version: '10.x' registry-url: 'https://npm.pkg.github.com' # Defaults to the user or organization that owns the workflow file scope: '@screeps' - - run: npm ci - - run: npm publish + - name: ๐Ÿ‘ท Install + run: npm ci env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: ๐Ÿ“ฆ๏ธ Publish package (github registry) + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: ๐Ÿ”จ Setup node (npmjs) + uses: actions/setup-node@v3 + with: + node-version: '10.x' + registry-url: 'https://registry.npmjs.org' + scope: '@screeps' + - name: ๐Ÿ“ฆ๏ธ Publish package (npmjs) + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}