Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-and-test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Build SDK
run: |
npm install
npm run build
- name: Install test-app dependencies
run: npm install
working-directory: test-app
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
working-directory: test-app
- name: Run Playwright tests
run: npx playwright test
working-directory: test-app
env:
CI: true
32 changes: 0 additions & 32 deletions .github/workflows/nodejs.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,22 @@ on:


jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Build and Test
run: |
npm install
npm run build
npm run test
env:
CI: true

publish:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 20.x
registry-url: https://registry.npmjs.org/
- name: NPM Publish
run: |
npm install
npm run build
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
# print the NPM user name for validation
npm whoami
VERSION=$(node -p "require('./package.json').version" )
Expand All @@ -52,7 +32,7 @@ jobs:
NPM_TAG="beta"
fi
echo "Publishing $VERSION with $NPM_TAG tag."
npm publish --tag $NPM_TAG --access public
npm publish --tag $NPM_TAG --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
CI: true
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: release-please

on:
push:
branches:
- master

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
63 changes: 63 additions & 0 deletions .github/workflows/sync-release-as.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Sync Release-As from release PR title

on:
pull_request:
types: [edited]

permissions:
contents: write

jobs:
sync:
if: >-
github.event.pull_request.base.ref == 'master' &&
startsWith(github.event.pull_request.head.ref, 'release-please--') &&
github.event.changes.title != null
runs-on: ubuntu-latest
steps:
- name: Extract versions from old and new title
id: parse
env:
NEW_TITLE: ${{ github.event.pull_request.title }}
OLD_TITLE: ${{ github.event.changes.title.from }}
run: |
# Anchored on pull-request-title-pattern "release: ${version}" from release-please-config.json.
extract() {
echo "$1" | grep -oE '^release:[[:space:]]+v?[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?' \
| sed -E 's/^release:[[:space:]]+v?//'
}
NEW_VERSION=$(extract "$NEW_TITLE")
OLD_VERSION=$(extract "$OLD_TITLE")
echo "old=$OLD_VERSION"
echo "new=$NEW_VERSION"
if [ -z "$NEW_VERSION" ]; then
echo "::notice::No semver in new title; nothing to do."
echo "skip=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if [ "$NEW_VERSION" = "$OLD_VERSION" ]; then
echo "::notice::Version unchanged ($NEW_VERSION); not pushing."
echo "skip=true" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"

- name: Check out master
if: steps.parse.outputs.skip != 'true'
uses: actions/checkout@v6
with:
ref: master
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
fetch-depth: 1
Comment thread
imagekitio marked this conversation as resolved.

- name: Push empty Release-As commit
if: steps.parse.outputs.skip != 'true'
env:
VERSION: ${{ steps.parse.outputs.version }}
run: |
git config user.name "release-as-bot"
git config user.email "release-as-bot@users.noreply.github.com"
git commit --allow-empty -m "chore: pin next release

Release-As: ${VERSION}"
git push origin master
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules/*
samples/sample-app/node_modules/*
node_modules
.env
.vscode
.DS_Store
Expand Down
6 changes: 0 additions & 6 deletions .mocharc.json

This file was deleted.

5 changes: 0 additions & 5 deletions .nycrc.json

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "5.4.0"
}
Loading
Loading