Skip to content

Upgraded dependencies; require node >= 18 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2024
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
102 changes: 50 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,60 @@ name: CI
on:
push:
paths-ignore:
- '*.md'
branches: [ main ]
- "*.md"
branches: [main]
tags:
- '*'
- "*"
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Cache node_modules
uses: actions/cache@v3
with:
path: |
~/.npm
~/.nvm
~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/node_modules
~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/package-lock.json
key: ${{ runner.os }}-node_modules-cache-v3-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-cache-v3-

- name: Extract Tag Name
run: echo "TAG_NAME=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
if: ${{ startsWith(github.ref, 'refs/tags') }}

- name: Run tests
run: |
npm i
node --test
if: ${{ env.TAG_NAME == '' }}

- name: Build SNAPSHOT
run: npm pack
if: ${{ env.TAG_NAME == '' }}

- name: Publish RELEASE
run: |
VERSION="$(echo "$TAG_NAME" | cut -d'v' -f 2)"
echo "Publish a release version=$VERSION for tag $TAG_NAME"
npm --no-git-tag-version --allow-same-version version $VERSION
npm pack
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
npm publish --access=public farjs-better-sqlite3-wrapper-${VERSION}.tgz
if: ${{ env.TAG_NAME != '' }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Cache node_modules
uses: actions/cache@v4
with:
path: |
~/.npm
~/.nvm
~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/node_modules
~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/package-lock.json
key: ${{ runner.os }}-node_modules-cache-v4-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-cache-v4-

- name: Extract Tag Name
run: echo "TAG_NAME=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
if: ${{ startsWith(github.ref, 'refs/tags') }}

- name: Run tests
run: |
npm i
node ./index.test.js
if: ${{ env.TAG_NAME == '' }}

- name: Build SNAPSHOT
run: npm pack
if: ${{ env.TAG_NAME == '' }}

- name: Publish RELEASE
run: |
VERSION="$(echo "$TAG_NAME" | cut -d'v' -f 2)"
echo "Publish a release version=$VERSION for tag $TAG_NAME"
npm --no-git-tag-version --allow-same-version version $VERSION
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
npm publish
if: ${{ env.TAG_NAME != '' }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39 changes: 24 additions & 15 deletions .github/workflows/ci_bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,36 @@ name: Bun CI
on:
push:
paths-ignore:
- '*.md'
branches: [ main ]
- "*.md"
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: "1.0.1"

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: "0.5.8"
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
~/work/better-sqlite3-wrapper/better-sqlite3-wrapper/bun.lockb
key: ${{ runner.os }}-bun-cache-v1-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-bun-cache-v1-

- name: Run tests
run: |
bun install
bun test
- name: Run tests
run: |
bun install
bun test
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"url": "git+https://github.com/farjs/better-sqlite3-wrapper.git"
},
"author": "viktor-podzigun",
"private": false,
"description": "Thin api wrapper around better-sqlite3 and bun:sqlite to allow cross- runtime/engine usage",
"license": "MIT",
"bugs": {
Expand All @@ -27,12 +26,16 @@
"main": "./index.js",
"exports": "./index.js",
"typings": "./index.d.ts",
"private": false,
"publishConfig": {
"access": "public"
},
"browserslist": "maintained node versions",
"engines": {
"node": ">=14.21.1",
"bun": ">=0.5.8"
"node": ">=18",
"bun": ">=0.8"
},
"optionalDependencies": {
"better-sqlite3": "^8.2.0"
"better-sqlite3": "^11.5.0"
}
}