Skip to content

Commit d59e1eb

Browse files
authored
chore: add preview release (#1097)
## What kind of change does this PR introduce? Infrastructure improvement - adds a preview release workflow for easier testing of changes. ## What is the current behavior? Contributors and maintainers need to manually build and test changes locally or wait for official releases to test package changes. ## What is the new behavior? - Adds automated preview release workflow using [`pkg.pr.new`](https://github.com/stackblitz-labs/pkg.pr.new) - Triggers on pushes to `master` branch and PRs with the `trigger: preview` label - Automatically publishes preview packages that can be installed and tested - Provides temporary package URLs for quick testing without affecting the main package ## Additional context This workflow allows for: - Quick testing of PR changes before merging - Easy collaboration on features by sharing preview package links - Reduced friction in the development and review process The workflow uses the `trigger: preview` label to control when preview releases are created for PRs, preventing unnecessary builds while allowing on-demand testing.
1 parent 483e24b commit d59e1eb

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/preview-release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Preview release
2+
3+
permissions:
4+
pull-requests: write
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
types: [opened, synchronize, labeled]
12+
13+
jobs:
14+
preview:
15+
if: >
16+
github.repository == 'supabase/auth-js' &&
17+
(github.event_name == 'push' ||
18+
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'trigger: preview')))
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
cache: 'npm'
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Build
34+
run: npm run build
35+
36+
- run: npx pkg-pr-new@latest publish --compact

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
An isomorphic JavaScript client library for the [Supabase Auth](https://github.com/supabase/auth) API.
44

5+
<div align="center">
6+
7+
[![pkg.pr.new](https://pkg.pr.new/badge/supabase/auth-js)](https://pkg.pr.new/~/supabase/auth-js)
8+
9+
</div>
10+
511
## Docs
612

713
- Using `auth-js`: https://supabase.com/docs/reference/javascript/auth-signup

0 commit comments

Comments
 (0)