-
-
Notifications
You must be signed in to change notification settings - Fork 166
61 lines (49 loc) · 1.38 KB
/
manual-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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 'Package: ${{ inputs.package }}'
echo 'Version: ${{ inputs.version }}'
echo 'Reason: ${{ inputs.reason }}'
- 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
- name: Publish @supabase/${{ inputs.package }} @v${{ inputs.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!