-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add manual package publish on git tag
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Manual Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package: | ||
description: Package name | ||
type: choice | ||
required: true | ||
options: | ||
- auth-js | ||
- gotrue-js | ||
version: | ||
description: Version to publish (1.2.3 not v1.2.3) | ||
type: string | ||
required: true | ||
reason: | ||
description: Why are you manually publishing? | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- run: echo ${{ toJSON(inputs) }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: v${{ inputs.version }} | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '20' | ||
|
||
- run: | | ||
npm ci | ||
npm run build | ||
- run: | | ||
set -ex | ||
sed -i 's/0.0.0/${{ inputs.ref }}/' package.json | ||
- name: Publish @supabase/${{ input.package }} @v${{ input.version }} | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc | ||
set -ex | ||
for f in package.json package-lock.json | ||
do | ||
sed -i 's/0.0.0/${{ inputs.version }}/' "$f" | ||
sed -i 's|\(["/]\)auth-js|\1${{ inputs.package }}|g' "$f" | ||
done | ||
npm publish # not with --tag latest! | ||