This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
Publish #95
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/master' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.ADMIN_TOKEN }} | |
ref: 'master' | |
# 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 '@aspecto-system' | |
git config --global user.email 'michael@aspecto.io' | |
- 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 }} | |