-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |