From 8b174edd50a97c124534e24eeca43f320bc71c31 Mon Sep 17 00:00:00 2001 From: Simon MacDonald Date: Sat, 14 Nov 2020 17:15:51 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=20Update=20publish=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflow/npm-publish.yml | 52 +++++++++++++++++--------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflow/npm-publish.yml b/.github/workflow/npm-publish.yml index b199e7de..e5f2cc39 100644 --- a/.github/workflow/npm-publish.yml +++ b/.github/workflow/npm-publish.yml @@ -1,32 +1,36 @@ name: npm-publish on: push: - tags: - - '*' + branches: + - main jobs: npm-publish: - # Run on latest version of ubuntu + name: npm-publish runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 - # install Node.js - - name: Use Node.js 12 - uses: actions/setup-node@v1 - with: - node-version: 12 - # Specifies the registry, this field is required! - registry-url: https://registry.npmjs.org/ - - run: npm install -g yarn - # clean install of your projects' deps. We use "npm ci" to avoid package lock changes - - run: yarn install - # build the project - - run: yarn run build - # run tests just in case - - run: yarn run test - # publish to NPM -> there is one caveat, continue reading for the fix - - run: npm publish - env: - # Use a token to publish to NPM. See below for how to set it up - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Checkout repository + uses: actions/checkout@master + - name: Set up Node.js + uses: actions/setup-node@master + with: + node-version: 12 + - name: Install yarn + run: npm install -g yarn + - name: Clean install + run: yarn install + - name: Build package + run: yarn run build + - name: Run tests + run: yarn run test + - name: Publish if version has been updated + uses: mkiki/npm-publish-action@c4315ef5790b7bcec2cbb75b34e37681a409d78d + with: # All of theses inputs are optional + tag_name: 'v%s' + tag_message: 'v%s' + commit_pattern: "^Release (\\S+)" + workspace: '.' + env: # More info about the environment variables in the README + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated + NPM_AUTH_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} # This will be shared with your repo as an org secret + NPM_AUTH: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} # This will be shared with your repo as an org secret