v1.2.0 #8
Workflow file for this run
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: | |
release: | |
types: [released] | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: false # enqueue deployment jobs | |
env: | |
SLACK_DEPLOY_BOT_TOKEN: ${{ secrets.SLACK_DEPLOY_BOT_TOKEN }} | |
SLACK_DEPLOY_CHANNEL: ${{ vars.SLACK_DEPLOY_CHANNEL }} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Post to Slack | |
uses: Fieldguide/action-slack-deploy-pipeline@v2 | |
id: slack | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Parse version | |
id: version | |
run: echo "value=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT | |
- name: Update npm package version for build / publishing | |
run: npm version ${{ steps.version.outputs.value }} --no-git-tag-version | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "npm" | |
registry-url: "https://registry.npmjs.org" | |
scope: "@fieldguide" | |
- name: Install dependencies | |
run: npm ci --prefer-offline --no-audit | |
- name: Publish package | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: "Post to Slack" | |
uses: Fieldguide/action-slack-deploy-pipeline@v2 | |
if: always() | |
with: | |
thread_ts: ${{ steps.slack.outputs.ts }} | |
conclusion: true |