chore(master): release 2.0.1 #19
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 beta package | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
# Only run this job if the PR is from a trusted collaborator (i.e. not a fork) | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
env: | |
CEREBRUM_NPM_TOKEN: ${{ secrets.CEREBRUM_NPM_TOKEN }} | |
steps: | |
# Checkout project repository | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Setup Node.js environment | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
registry-url: https://registry.npmjs.org/ | |
node-version: 20 | |
# Use a cache for dependencies | |
- uses: actions/cache@v4 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} | |
# Install dependencies so that prepublish scripts work as expected | |
- name: Install deps | |
run: npm i | |
# Update package version to a beta release, including the git commit sha | |
- name: Bump package.json | |
run: | | |
npm --no-git-tag-version version $(npm show . version)-beta.dangerous.$(git rev-parse --short HEAD) | |
# Publish version to npm | |
- name: Publish beta package | |
run: npm publish --tag beta | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.CEREBRUM_PUBLISH_NPM_TOKEN }} |