Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/release-postgrest-typegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release postgrest-typegen

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs['packages/postgrest-typegen--release_created'] }}
tag_name: ${{ steps.release.outputs['packages/postgrest-typegen--tag_name'] }}
steps:
- name: Generate token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.GH_APP_CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: release
with:
config-file: release-please-config.postgrest-typegen.json
manifest-file: .release-please-manifest.postgrest-typegen.json
target-branch: ${{ github.ref_name }}
token: ${{ steps.app-token.outputs.token }}

publish-postgrest-typegen:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: packages/postgrest-typegen
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ needs.release-please.outputs.tag_name }}

- name: Install bun
run: curl -fsSL https://bun.sh/install | bash

- name: Add bun to PATH
run: echo "$HOME/.bun/bin" >> "$GITHUB_PATH"

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- name: Install latest npm for OIDC trusted publishing
run: |
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"
npm install -g npm@latest
npm --version

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build
run: bun run build

- name: Publish to npm
run: npm publish --access public --provenance
49 changes: 1 addition & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Release

# packages/postgrest-typegen is released on demand, see release-postgrest-typegen.yml
on:
workflow_run:
workflows: ["Validate Capabilities"]
Expand All @@ -21,9 +22,6 @@ jobs:
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_repository.full_name == github.repository)
runs-on: ubuntu-latest
outputs:
postgrest_typegen_release_created: ${{ steps.release.outputs['packages/postgrest-typegen--release_created'] }}
postgrest_typegen_tag_name: ${{ steps.release.outputs['packages/postgrest-typegen--tag_name'] }}
steps:
- name: Generate token
id: app-token
Expand All @@ -37,48 +35,3 @@ jobs:
with:
target-branch: ${{ github.event_name == 'workflow_dispatch' && github.ref_name || github.event.workflow_run.head_branch }}
token: ${{ steps.app-token.outputs.token }}

publish-postgrest-typegen:
needs: release-please
if: needs.release-please.outputs.postgrest_typegen_release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: packages/postgrest-typegen
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ needs.release-please.outputs.postgrest_typegen_tag_name }}

- name: Install bun
run: curl -fsSL https://bun.sh/install | bash

- name: Add bun to PATH
run: echo "$HOME/.bun/bin" >> "$GITHUB_PATH"

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- name: Install latest npm for OIDC trusted publishing
run: |
mkdir -p "$HOME/.npm-global"
npm config set prefix "$HOME/.npm-global"
echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"
npm install -g npm@latest
npm --version

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build
run: bun run build

- name: Publish to npm
run: npm publish --access public --provenance
3 changes: 1 addition & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"packages/capability-matrix": "1.6.0",
"packages/postgrest-typegen": "0.2.0"
"packages/capability-matrix": "1.6.0"
}
3 changes: 3 additions & 0 deletions .release-please-manifest.postgrest-typegen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"packages/postgrest-typegen": "0.2.0"
}
4 changes: 4 additions & 0 deletions packages/postgrest-typegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ Not yet published; consumed in-repo for now (`packages/postgrest-typegen`).
npm install pg
```

## Releasing

Unlike the rest of this repo, merging a change here does not open a release pull request on its own. Releases are cut on demand: run the `Release postgrest-typegen` workflow from the Actions tab, which runs release-please against `release-please-config.postgrest-typegen.json` and opens (or updates) the release pull request for this package. Merging that pull request tags the release and publishes to npm.

## License

MIT
6 changes: 1 addition & 5 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"separate-pull-requests": true,
"packages": {
"packages/capability-matrix": {
"release-type": "node",
"package-name": "@supabase/capability-matrix-validator",
"component": "capability-matrix"
},
"packages/postgrest-typegen": {
"release-type": "node",
"package-name": "@supabase/postgrest-typegen",
"bump-minor-pre-major": true
}
}
}
12 changes: 12 additions & 0 deletions release-please-config.postgrest-typegen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"separate-pull-requests": true,
"packages": {
"packages/postgrest-typegen": {
"release-type": "node",
"package-name": "@supabase/postgrest-typegen",
"component": "postgrest-typegen",
"bump-minor-pre-major": true
}
}
}