Skip to content

cicd: add releases for next versions #52

cicd: add releases for next versions

cicd: add releases for next versions #52

Workflow file for this run

name: Release
on:
push:
branches:
- main
- next
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.10.0]
steps:
- uses: actions/checkout@v2
- name: If we're in next, check if pre.json exists
if: github.ref == 'refs/heads/next'
run: |
[ -f ./.changeset/pre.json ] || { echo "Error: pre.json does not exist but needed for 'next' release" >&2; exit 1; }
- name: If we're in main, make sure pre.json isn't there
if: github.ref == 'refs/heads/main'
run: |
[ ! -f ./.changesets/pre.json ] || { echo "Error: pre.json should not exist when releasing main" >&2; exit 1; }
- uses: pnpm/action-setup@v2
with:
version: 8.14.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: pnpm run bootstrap
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm run version
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_OPTIONS: --max-old-space-size=4096