Skip to content

Version Packages (beta) #43

Version Packages (beta)

Version Packages (beta) #43

Workflow file for this run

name: Pre-release
on:
pull_request:
branches:
- pre-release
types:
- closed
env:
HUSKY: 0
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
pre-release:
if: github.event.pull_request.merged == true
name: Pre-release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Cache
uses: actions/cache@v4
with:
path: |
/home/runner/work/packages/packages/node_modules/.cache/eslint/
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/.eslintrc.cjs') }}
- name: Install Dependencies
run: npm ci
- run: |
! npx changeset pre enter beta &>/dev/null || (echo "Pre-release branch must be in pre-release mode to run a release, please run \`npx changeset pre enter beta\` and commit the changes" && exit 1)
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: npm run release
setupGitUser: true
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}