Version Packages (#26) #33
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: Version or Publish | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
id: pnpm-install | |
with: | |
version: 8 | |
run_install: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- id: pnpm-cache-config | |
shell: bash | |
run: | | |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
name: Cache NPM dependencies | |
id: deps-cache | |
with: | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
path: | | |
${{ steps.pnpm-cache-config.outputs.pnpm_cache_dir }} | |
**/node_modules | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: install deps (with cache) | |
if: steps.deps-cache.outputs.cache-hit != 'true' | |
run: pnpm install | |
- name: Create Release Pull Request or Publish | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |