This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
Archive repo #45
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: Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
permissions: {} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
# prevents this action from running on forks | |
if: github.repository == 'goknsh/svelte-query-pocketbase' | |
permissions: | |
contents: write # to push commits and tags (changesets/action) | |
pull-requests: write # to create pull request (changesets/action) | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
# Global dependencies are not cached, we use pnpm cache instead | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
run_install: false | |
version: 7.26.0 | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm run release | |
commit: 'chore: version package' | |
title: 'chore: version package' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |