Skip to content

Commit

Permalink
🔧 Update publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Nov 14, 2020
1 parent 2b826c9 commit 8b174ed
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions .github/workflow/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8b174ed

Please sign in to comment.