Skip to content

Commit 726a51b

Browse files
committed
Merge remote-tracking branch 'origin/0.50' into feat/plugin/base
2 parents e348631 + 4571189 commit 726a51b

File tree

85 files changed

+950
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+950
-162
lines changed

.github/workflows/auth-react-test-1.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,36 @@ on:
77
- reopened
88
- synchronize
99
push:
10-
branches:
11-
- master
12-
- "v[0-9]+.[0-9]+"
1310
tags:
14-
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
11+
- dev-v[0-9]+.[0-9]+.[0-9]+
12+
13+
# Only one instance of this workflow will run on the same ref (PR/Branch/Tag)
14+
# Previous runs will be cancelled.
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
1518

1619
jobs:
1720
define-versions:
1821
runs-on: ubuntu-latest
1922
outputs:
2023
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
24+
25+
nodeFdiVersionMap: ${{ steps.node-versions.outputs.fdiVersions }}
2126
steps:
2227
- uses: actions/checkout@v4
2328
- uses: supertokens/get-supported-versions-action@main
2429
id: versions
2530
with:
2631
has-fdi: true
2732

33+
- uses: supertokens/actions/get-versions-from-repo@main
34+
id: node-versions
35+
with:
36+
repo: supertokens-node
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
fdi-versions: ${{ steps.versions.outputs.fdiVersions }}
39+
2840
setup-auth-react:
2941
runs-on: ubuntu-latest
3042
needs: define-versions
@@ -42,21 +54,30 @@ jobs:
4254
AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }}
4355
specs: ${{ steps.envs.outputs.specs }}
4456
fdiVersions: ${{ needs.define-versions.outputs.fdiVersions }}
57+
nodeFdiVersionMap: ${{ needs.define-versions.outputs.nodeFdiVersionMap }}
4558

4659
steps:
47-
- uses: supertokens/get-versions-action@main
48-
id: versions
60+
- id: repo-versions
61+
run: |
62+
nodeVersion=$( echo '${{ needs.define-versions.outputs.nodeFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' )
63+
echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT
64+
65+
# We will use this in the test run to get the core version
66+
- uses: actions/checkout@v4
4967
with:
50-
driver-name: node
51-
fdi-version: ${{ matrix.fdi-version }}
52-
env:
53-
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
68+
repository: supertokens/supertokens-node
69+
ref: ${{ steps.repo-versions.outputs.nodeVersion }}
70+
path: supertokens-node
71+
72+
# Makes npm use HTTP instead of SSH for installs
73+
- name: Reconfigure git to use HTTP authentication
74+
run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
5475

5576
- uses: supertokens/auth-react-testing-action/setup@main
5677
id: envs
5778
with:
5879
auth-react-version: ${{ github.sha }}
59-
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
80+
node-sdk-version: ${{ steps.repo-versions.outputs.nodeVersion }}
6081
fdi-version: ${{ matrix.fdi-version }}
6182
use-common-app-and-test-server: "true"
6283

.github/workflows/auth-react-test-2.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,38 @@ jobs:
6565
AUTH_REACT__PORT: ${{ inputs.AUTH_REACT__PORT }}
6666

6767
steps:
68-
- uses: actions/checkout@v4
68+
- uses: bissolli/gh-action-persist-workspace@v2
6969
with:
70-
path: supertokens-auth-react
70+
action: retrieve
71+
artifactName: auth-react-${{ inputs.fdi-version }}
72+
73+
- name: Get Node CDI versions
74+
id: node-cdi-versions
75+
uses: supertokens/get-supported-versions-action@main
76+
with:
77+
has-cdi: true
78+
working-directory: supertokens-node
79+
80+
- uses: supertokens/actions/get-versions-from-repo@main
81+
id: core-versions
82+
with:
83+
repo: supertokens-core
84+
github-token: ${{ secrets.GITHUB_TOKEN }}
85+
cdi-versions: ${{ steps.node-cdi-versions.outputs.cdiVersions }}
86+
87+
- name: Get core version from latest Node CDI version
88+
id: core-version
89+
run: |
90+
lastNodeCdiVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]') | sed -e 's/"/\\"/g'
91+
coreVersion=$(echo '${{ steps.core-versions.outputs.cdiVersions }}' | jq -r ".[$lastNodeCdiVersion]")
92+
93+
echo "coreVersion=${coreVersion}" >> $GITHUB_OUTPUT
7194
7295
- name: Start core
7396
run: docker compose up --wait
7497
working-directory: supertokens-auth-react
98+
env:
99+
SUPERTOKENS_CORE_VERSION: ${{ steps.core-version.outputs.coreVersion }}
75100

76101
- uses: supertokens/auth-react-testing-action@main
77102
name: test ${{ matrix.spec }} for ${{ inputs.fdi-version }}
@@ -80,3 +105,4 @@ jobs:
80105
check-name-suffix: "[FDI=${{ inputs.fdi-version }}][Spec=${{ matrix.spec }}]"
81106
path: supertokens-auth-react
82107
spec: ${{ matrix.spec }}
108+
retrieve-workspace: false

.github/workflows/chromatic.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@ name: "Chromatic"
22

33
on:
44
push:
5-
branches: [master, "[0-9]*.[0-9]*"]
5+
branches:
6+
- master
7+
- "[0-9]*.[0-9]*"
8+
tags:
9+
- dev-v[0-9]+.[0-9]+.[0-9]+
610
workflow_dispatch:
711

12+
# Only one instance of this workflow will run on the same ref (PR/Branch/Tag)
13+
# Previous runs will be cancelled.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
818
jobs:
919
chromatic:
1020
runs-on: ubuntu-latest
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: "Dev Tag Pipeline"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: The branch to create the dev tag on
8+
type: string
9+
required: true
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
setup:
16+
runs-on: ubuntu-latest
17+
18+
outputs:
19+
packageVersion: ${{ steps.versions.outputs.packageVersion }}
20+
packageVersionXy: ${{ steps.versions.outputs.packageVersionXy }}
21+
packageLockVersion: ${{ steps.versions.outputs.packageLockVersion }}
22+
packageLockVersionXy: ${{ steps.versions.outputs.packageLockVersionXy }}
23+
newestVersion: ${{ steps.versions.outputs.newestVersion }}
24+
targetBranch: ${{ steps.versions.outputs.targetBranch }}
25+
devTag: ${{ steps.versions.outputs.devTag }}
26+
releaseTag: ${{ steps.versions.outputs.releaseTag }}
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
ref: ${{ inputs.branch }}
32+
# Need a complete fetch to make the master merge check work
33+
fetch-depth: 0
34+
fetch-tags: true
35+
token: ${{ secrets.ALL_REPO_PAT }}
36+
37+
- name: Setup git
38+
run: |
39+
# NOTE: The user email is {user.id}+{user.login}@users.noreply.github.com.
40+
# See users API: https://api.github.com/users/github-actions%5Bbot%5D
41+
git config user.name "github-actions[bot]"
42+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
43+
44+
git fetch origin master
45+
46+
- name: Check if branch needs master merge
47+
run: |
48+
if [[ $(git log origin/master ^HEAD) != "" ]]; then
49+
echo "You need to merge master into this branch."
50+
exit 1
51+
fi
52+
53+
- name: Populate variables
54+
id: versions
55+
run: |
56+
. ./hooks/populate-hook-constants.sh
57+
58+
echo "packageVersion=$packageVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
59+
echo "packageVersionXy=$packageVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
60+
echo "packageLockVersion=$packageLockVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
61+
echo "packageLockVersionXy=$packageLockVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
62+
echo "newestVersion=$newestVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
63+
echo "targetBranch=$targetBranch" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
64+
65+
echo "devTag=dev-v$packageLockVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
66+
echo "releaseTag=v$packageLockVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
67+
68+
- name: Check tag and branch correctness
69+
run: |
70+
if [[ "${{ steps.versions.outputs.packageVersion }}" != "${{ steps.versions.outputs.packageLockVersion }}" ]]
71+
then
72+
echo "The package version and package lock version do not match."
73+
exit 1
74+
fi
75+
76+
if [[ "${{ steps.versions.outputs.packageVersion }}" != ${{ inputs.branch }}* ]]
77+
then
78+
echo "Adding tag to wrong branch"
79+
exit 1
80+
fi
81+
82+
if git rev-parse ${{ steps.versions.outputs.releaseTag }} >/dev/null 2>&1
83+
then
84+
echo "The released version of this tag already exists."
85+
exit 1
86+
fi
87+
88+
- name: Delete tag if already tagged
89+
run: |
90+
git tag --delete ${{ steps.versions.outputs.devTag }} || true
91+
git push --delete origin ${{ steps.versions.outputs.devTag }} || true
92+
93+
- name: Install dependencies
94+
run: npm install
95+
96+
- name: Build docs
97+
run: |
98+
npm run build-pretty
99+
npm run build-docs
100+
101+
- name: Commit doc changes
102+
run: |
103+
git add --all
104+
git commit --allow-empty -nm "doc: update docs for ${{ steps.versions.outputs.releaseTag }} tag"
105+
git push
106+
107+
- name: Create and push tag
108+
run: |
109+
# NOTE: The user email is {user.id}+{user.login}@users.noreply.github.com.
110+
# See users API: https://api.github.com/users/github-actions%5Bbot%5D
111+
git config user.name "github-actions[bot]"
112+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
113+
114+
git tag ${{ steps.versions.outputs.devTag }}
115+
git push --tags --follow-tags
116+
117+
mark-dev-tag-as-not-passed:
118+
runs-on: ubuntu-latest
119+
needs:
120+
- setup
121+
122+
steps:
123+
- uses: actions/checkout@v4
124+
with:
125+
ref: ${{ needs.setup.outputs.devTag }}
126+
fetch-tags: true
127+
128+
- id: versions
129+
uses: supertokens/get-supported-versions-action@main
130+
with:
131+
has-cdi: false
132+
has-fdi: true
133+
has-web-js: true
134+
135+
- id: escape-versions
136+
run: |
137+
echo "fdiVersions=$(sed 's/"/\\"/g' <<< '${{ steps.versions.outputs.fdiVersions }}')" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
138+
echo "webJsInterfaceVersion=$(sed 's/"/\\"/g' <<< '${{ steps.versions.outputs.webJsInterfaceVersion }}')" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
139+
140+
- run: |
141+
./hooks/populate-hook-constants.sh
142+
143+
curl --fail-with-body -X PUT \
144+
https://api.supertokens.io/0/frontend \
145+
-H 'Content-Type: application/json' \
146+
-H 'api-version: 1' \
147+
-d "{
148+
\"password\": \"${{ secrets.SUPERTOKENS_API_KEY }}\",
149+
\"version\":\"${{ needs.setup.outputs.packageVersion }}\",
150+
\"name\": \"auth-react\",
151+
\"frontendDriverInterfaces\": ${{ steps.escape-versions.outputs.fdiVersions }},
152+
\"webJsInterface\": \"${{ steps.escape-versions.outputs.webJsInterfaceVersion }}\"
153+
}"

0 commit comments

Comments
 (0)