Skip to content

Merge pull request #211 from arethetypeswrong/changeset-release/main #148

Merge pull request #211 from arethetypeswrong/changeset-release/main

Merge pull request #211 from arethetypeswrong/changeset-release/main #148

# - changesets will open a PR to bump versions when new changesets are added
# - changesets will publish packages when that PR is merged
# (it's confusing because the same action does two super different things)
name: Version or Publish Packages
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: 21
- uses: pnpm/action-setup@v2
with:
version: latest
run_install: false
- id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- run: pnpm install
- run: pnpm build
- run: pnpm test
- run: pnpm check-dts
- uses: changesets/action@v1
with:
publish: pnpm publish -r
version: pnpm run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}