Publish #29
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
name: Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
semanticVersion: | |
description: 'Semantic Version [major | minor | patch ]' | |
required: true | |
default: 'patch' | |
jobs: | |
Publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.ADMIN_TOKEN }} | |
ref: 'main' | |
# pulls all commits (needed for lerna / semantic release to correctly version) | |
fetch-depth: '0' | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Configure CI Git User | |
run: | | |
git config --global user.name 'Justin Smith' | |
git config --global user.email '[email protected]' | |
- name: Install Packages | |
run: yarn install | |
- name: Build | |
run: yarn build | |
- name: Authenticate with Registry | |
run: | | |
yarn logout | |
echo "registry=http://registry.npmjs.org/" >> .npmrc | |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc | |
npm whoami | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish package | |
run: | | |
yarn publish:ci ${{ github.event.inputs.semanticVersion }} | |
env: | |
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }} |