Skip to content

Commit ce4fc3c

Browse files
authored
Merge pull request #116 from imagekit-developer/base64-fix
Base64 fix and test cases refactor to use real browser
2 parents 857aa2b + 774bedf commit ce4fc3c

40 files changed

Lines changed: 3228 additions & 8962 deletions

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-and-test:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Use Node.js 20.x
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20.x
26+
- name: Build SDK
27+
run: |
28+
npm install
29+
npm run build
30+
- name: Install test-app dependencies
31+
run: npm install
32+
working-directory: test-app
33+
- name: Install Playwright browsers
34+
run: npx playwright install --with-deps chromium
35+
working-directory: test-app
36+
- name: Run Playwright tests
37+
run: npx playwright test
38+
working-directory: test-app
39+
env:
40+
CI: true

.github/workflows/nodejs.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,22 @@ on:
66

77

88
jobs:
9-
build:
10-
11-
runs-on: ubuntu-latest
12-
13-
strategy:
14-
matrix:
15-
node-version: [20.x]
16-
17-
steps:
18-
- uses: actions/checkout@v1
19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v1
21-
with:
22-
node-version: ${{ matrix.node-version }}
23-
- name: Build and Test
24-
run: |
25-
npm install
26-
npm run build
27-
npm run test
28-
env:
29-
CI: true
30-
319
publish:
32-
needs: build
3310
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
3414
steps:
35-
- uses: actions/checkout@v1
36-
- uses: actions/setup-node@v1
15+
- uses: actions/checkout@v4
16+
- name: Use Node.js 20.x
17+
uses: actions/setup-node@v4
3718
with:
38-
node-version: 20
19+
node-version: 20.x
3920
registry-url: https://registry.npmjs.org/
4021
- name: NPM Publish
4122
run: |
4223
npm install
4324
npm run build
44-
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
4525
# print the NPM user name for validation
4626
npm whoami
4727
VERSION=$(node -p "require('./package.json').version" )
@@ -52,7 +32,7 @@ jobs:
5232
NPM_TAG="beta"
5333
fi
5434
echo "Publishing $VERSION with $NPM_TAG tag."
55-
npm publish --tag $NPM_TAG --access public
35+
npm publish --tag $NPM_TAG --provenance --access public
5636
env:
5737
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
5838
CI: true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
config-file: release-please-config.json
19+
manifest-file: .release-please-manifest.json
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Sync Release-As from release PR title
2+
3+
on:
4+
pull_request:
5+
types: [edited]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
sync:
12+
if: >-
13+
github.event.pull_request.base.ref == 'master' &&
14+
startsWith(github.event.pull_request.head.ref, 'release-please--') &&
15+
github.event.changes.title != null
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Extract versions from old and new title
19+
id: parse
20+
env:
21+
NEW_TITLE: ${{ github.event.pull_request.title }}
22+
OLD_TITLE: ${{ github.event.changes.title.from }}
23+
run: |
24+
# Anchored on pull-request-title-pattern "release: ${version}" from release-please-config.json.
25+
extract() {
26+
echo "$1" | grep -oE '^release:[[:space:]]+v?[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?' \
27+
| sed -E 's/^release:[[:space:]]+v?//'
28+
}
29+
NEW_VERSION=$(extract "$NEW_TITLE")
30+
OLD_VERSION=$(extract "$OLD_TITLE")
31+
echo "old=$OLD_VERSION"
32+
echo "new=$NEW_VERSION"
33+
if [ -z "$NEW_VERSION" ]; then
34+
echo "::notice::No semver in new title; nothing to do."
35+
echo "skip=true" >> "$GITHUB_OUTPUT"
36+
exit 0
37+
fi
38+
if [ "$NEW_VERSION" = "$OLD_VERSION" ]; then
39+
echo "::notice::Version unchanged ($NEW_VERSION); not pushing."
40+
echo "skip=true" >> "$GITHUB_OUTPUT"
41+
exit 0
42+
fi
43+
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
44+
45+
- name: Check out master
46+
if: steps.parse.outputs.skip != 'true'
47+
uses: actions/checkout@v6
48+
with:
49+
ref: master
50+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
51+
fetch-depth: 1
52+
53+
- name: Push empty Release-As commit
54+
if: steps.parse.outputs.skip != 'true'
55+
env:
56+
VERSION: ${{ steps.parse.outputs.version }}
57+
run: |
58+
git config user.name "release-as-bot"
59+
git config user.email "release-as-bot@users.noreply.github.com"
60+
git commit --allow-empty -m "chore: pin next release
61+
62+
Release-As: ${VERSION}"
63+
git push origin master

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
node_modules/*
2-
samples/sample-app/node_modules/*
1+
node_modules
32
.env
43
.vscode
54
.DS_Store

.mocharc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

.nycrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "5.4.0"
3+
}

0 commit comments

Comments
 (0)