Publish to NPM #7
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 to NPM | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
concurrency: | |
cancel-in-progress: true | |
group: publish-${{ github.ref }} | |
jobs: | |
publish_to_npm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x | |
registry-url: "https://registry.npmjs.org" | |
cache: npm | |
- name: Configure git | |
run: | | |
git config --local user.name 'github-action[bot]' | |
git config --local user.email 'github-action[bot]@github.com' | |
- run: yarn | |
- run: yarn test | |
- run: yarn depcruise | |
- run: export YARN_NPM_AUTH_TOKEN=${{ secrets.NPM_TOKEN }} | |
- run: yarn monodeploy | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export CURRENT_VERSION=v$(npm pkg get version | tr -d '"') | |
gh release create $CURRENT_VERSION --generate-notes |