Merge branch 'master' of https://github.com/satohshi/pocketbase-ts-sc… #3
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: Create release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install Dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Create Release | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm changeset tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
if: steps.changesets.outputs.published == 'true' | |
run: pnpm build | |
- name: Zip files | |
if: steps.changesets.outputs.published == 'true' | |
uses: thedoctor0/[email protected] | |
with: | |
type: zip | |
path: pb_hooks | |
filename: pb_hooks.zip | |
- name: Get latest release | |
if: steps.changesets.outputs.published == 'true' | |
id: get_latest_release | |
run: | | |
UPLOAD_URL=$(curl -sL \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
"https://api.github.com/repos/${{ github.repository }}/releases/latest" \ | |
| jq -r .upload_url) | |
echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_OUTPUT | |
- name: Upload Release Asset | |
if: steps.changesets.outputs.published == 'true' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_latest_release.outputs.UPLOAD_URL }} | |
asset_path: pb_hooks.zip | |
asset_name: pb_hooks.zip | |
asset_content_type: application/zip |