Skip to content

chore(deps-dev): bump vite from 7.0.6 to 7.3.2 in /examples/sk #57

chore(deps-dev): bump vite from 7.0.6 to 7.3.2 in /examples/sk

chore(deps-dev): bump vite from 7.0.6 to 7.3.2 in /examples/sk #57

Workflow file for this run

name: CI and Release
on:
pull_request:
branches: [ main, beta ]
push:
branches: [ main, beta ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
runtime:
- { name: "Node.js 20", type: "node", version: "20" }
- { name: "Node.js 22", type: "node", version: "22" }
- { name: "Node.js 24", type: "node", version: "24" }
- { name: "Bun latest", type: "bun", version: "latest" }
name: Test on ${{ matrix.runtime.name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start SurrealDB
uses: surrealdb/setup-surreal@v2
with:
surrealdb_version: latest
surrealdb_port: 8000
surrealdb_username: root
surrealdb_password: root
surrealdb_log: info
surrealdb_additional_args: --allow-all
- name: Setup Node.js
if: matrix.runtime.type == 'node'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.runtime.version }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build package
run: bun run build
- name: Wait for SurrealDB
run: |
echo "Waiting for SurrealDB..."
until curl --fail http://localhost:8000/status; do sleep 1; done
echo "SurrealDB is ready!"
- name: Run adapter tests (Node.js)
if: matrix.runtime.type == 'node'
run: npm run test:adapter
- name: Run adapter tests (Bun)
if: matrix.runtime.type == 'bun'
run: bun run test:adapter
- name: Install example dependencies
if: matrix.runtime.type == 'bun'
working-directory: examples/sk
run: bun install
- name: Cache Playwright Browsers
if: matrix.runtime.type == 'bun'
id: cache-playwright
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright Browsers
if: matrix.runtime.type == 'bun' && steps.cache-playwright.outputs.cache-hit != 'true'
working-directory: examples/sk
run: bunx playwright install --with-deps
- name: Run integration tests
if: matrix.runtime.type == 'bun'
working-directory: examples/sk
run: bunx playwright test
env:
CI: true
SURREALDB_URL: http://localhost:8000
SURREALDB_USER: root
SURREALDB_PASS: root
SURREALDB_NS: test
SURREALDB_DB: example-sveltekit
- name: Stop SurrealDB
if: always()
run: echo "Cleaning up..."
build:
needs: test
runs-on: ubuntu-latest
name: Build Artifact
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build package
run: bun run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: built-package
path: packages/surreal-better-auth/dist
release:
needs: build
runs-on: ubuntu-latest
name: Release to NPM
if: github.event_name == 'push'
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_PAT }}
fetch-depth: 0
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: built-package
path: packages/surreal-better-auth/dist
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Node.js for publishing
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
# --- BETA ---
- name: Perform Beta Release
if: github.ref == 'refs/heads/beta'
run: |
cp README.md packages/surreal-better-auth/dist/
cp packages/surreal-better-auth/LICENSE packages/surreal-better-auth/dist/
cd packages/surreal-better-auth
node -e '
const fs = require("fs"); const path = "./package.json"; const pkg = JSON.parse(fs.readFileSync(path, "utf8")); let current = pkg.version; let newVersion;
if (current.includes("-beta.")) { let [main, beta] = current.split("-beta."); newVersion = `${main}-beta.${parseInt(beta) + 1}`; } else { newVersion = `${current}-beta.0`; }
pkg.version = newVersion; fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + "\n"); console.log(`Version bumped to ${newVersion}`);
fs.appendFileSync(process.env.GITHUB_ENV, `NEW_VERSION=${newVersion}\n`);
'
node -e '
const fs = require("fs"); const path = "./dist/package.json";
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf8"));
delete pkg.files;
pkg.main = pkg.main.replace("./dist/", "./");
pkg.module = pkg.module.replace("./dist/", "./");
pkg.types = pkg.types.replace("./dist/", "./");
pkg.exports["."].types = pkg.exports["."].types.replace("./dist/", "./");
pkg.exports["."].import = pkg.exports["."].import.replace("./dist/", "./");
pkg.exports["."].require = pkg.exports["."].require.replace("./dist/", "./");
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + "\n");
'
cd dist
npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Commit, push, and tag (Beta)
if: github.ref == 'refs/heads/beta'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git pull
git add packages/surreal-better-auth/package.json
git commit -m "chore: bump version to ${{ env.NEW_VERSION }} [skip ci]"
git tag ${{ env.NEW_VERSION }}
git push && git push --tags
- name: Create GitHub Release (Beta)
if: github.ref == 'refs/heads/beta'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.NEW_VERSION }}
name: Beta Release ${{ env.NEW_VERSION }}
prerelease: true
generate_release_notes: true
# --- STABLE ---
- name: Perform Stable Release
if: github.ref == 'refs/heads/main'
run: |
cp README.md packages/surreal-better-auth/dist/
cp packages/surreal-better-auth/LICENSE packages/surreal-better-auth/dist/
cd packages/surreal-better-auth
node -e '
const fs = require("fs"); const path = "./package.json"; const pkg = JSON.parse(fs.readFileSync(path, "utf8"));
let stableVersion = pkg.version.split("-beta.")[0]; pkg.version = stableVersion;
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + "\n"); console.log(`Version bumped to ${stableVersion}`);
fs.appendFileSync(process.env.GITHUB_ENV, `STABLE_VERSION=${stableVersion}\n`);
'
node -e '
const fs = require("fs"); const path = "./dist/package.json";
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf8"));
delete pkg.files;
pkg.main = pkg.main.replace("./dist/", "./");
pkg.module = pkg.module.replace("./dist/", "./");
pkg.types = pkg.types.replace("./dist/", "./");
pkg.exports["."].types = pkg.exports["."].types.replace("./dist/", "./");
pkg.exports["."].import = pkg.exports["."].import.replace("./dist/", "./");
pkg.exports["."].require = pkg.exports["."].require.replace("./dist/", "./");
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + "\n");
'
cd dist
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Commit, tag and push (Stable)
if: github.ref == 'refs/heads/main'
run: |
git config --local user.email "53402105+oskar-gmerek@users.noreply.github.com"
git config --local user.name "Oskar Gmerek"
git pull
git add packages/surreal-better-auth/package.json
git commit -m "chore: release stable version ${{ env.STABLE_VERSION }} [skip ci]"
git tag v${{ env.STABLE_VERSION }}
git push
git push --tags
- name: Create GitHub Release (Stable)
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.STABLE_VERSION }}
name: Release ${{ env.STABLE_VERSION }}
generate_release_notes: true