Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
fde31 committed Sep 18, 2023
2 parents b6c9c9c + dfbe3ba commit 8b9a48c
Show file tree
Hide file tree
Showing 73 changed files with 1,727 additions and 2,308 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
"extends": "eslint:recommended",
"env": {
"es2017": true,
"node": true
},
"rules": {
Expand All @@ -9,4 +10,4 @@ module.exports = {
"semi": ["error", "always"],
"no-cond-assign": ["error", "always"]
}
}
};
14 changes: 14 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contributing

General guidelines for contributing to node-sqlite3

## Install Help

If you've landed here due to a failed install of `node-sqlite3` then feel free to create a [new issue](https://github.com/tryghost/node-sqlite3/issues/new) to ask for help. The most likely problem is that we do not yet provide pre-built binaries for your particular platform and so the `node-sqlite3` install attempted a source compile but failed because you are missing the [dependencies for node-gyp](https://github.com/nodejs/node-gyp#installation). Provide as much detail on your problem as possible and we'll try to help. Include:

- Logs of failed install (preferably from running `npm install sqlite3 --loglevel=info`)
- Version of `node-sqlite3` you tried to install
- Node version you are running
- Operating system and architecture you are running, e.g. `Windows 7 64 bit`.

The release process is documented in the wiki: https://github.com/TryGhost/node-sqlite3/wiki/Release-process
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 🐛 Bug report
description: Report a reproducible issue
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
## Welcome 👋
Thank you for taking the time to fill out a bug report 🙂
The more information you provide, the easier & quicker it is for us to diagnose the problem.
Please search the existing issues and recent releases to make sure your problem hasn't already been solved.
- type: textarea
id: summary
attributes:
label: Issue Summary
description: Explain what's wrong
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Steps to Reproduce
description: Also tell us, what did you expect to happen?
placeholder: |
1. This is the first step...
2. This is the second step, etc.
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: What version of `node-sqlite3` are you using?
validations:
required: true
- type: input
id: node
attributes:
label: Node.js Version
validations:
required: true
- type: input
id: os
attributes:
label: How did you install the library?
description: Provide details of your operating system and architecture
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 📖 API documentation
url: https://github.com/TryGhost/node-sqlite3/wiki/API
about: Documentation for the `node-sqlite3` API
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ✨ Feature request
description: Request a desired feature
labels: ["feature request"]
body:
- type: markdown
attributes:
value: |
## Welcome 👋
Thank you for taking the time to fill out a feature request
The more information you provide, the easier it is for us to understand your use case.
- type: textarea
id: summary
attributes:
label: Summary
description: Explain your use case. How would this improve your life?
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Proposed implementation
description: Give an API proposal. How would the feature work?
placeholder: |
The Database class has a new function called...
validations:
required: true
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/install_problem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ⚙️ Installation problem
description: Report an issue installing the library
labels: ["install problem"]
body:
- type: markdown
attributes:
value: |
## Welcome 👋
Thank you for taking the time to fill out a report with installing 🙂
The more information you provide, the easier & quicker it is for us to diagnose the problem.
Please search the existing issues and recent releases to make sure your problem hasn't already been solved.
- type: textarea
id: summary
attributes:
label: Issue Summary
description: Explain what's wrong
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant logs or output
placeholder: |
Error when installing `sqlite3` due to...
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: What version of `node-sqlite3` are you using?
validations:
required: true
- type: input
id: node
attributes:
label: Node.js Version
validations:
required: true
- type: input
id: os
attributes:
label: How did you install the library?
description: Provide details of your operating system and architecture
validations:
required: true
174 changes: 174 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
tags:
- '*'
env:
FORCE_COLOR: 1
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-20.04
- windows-latest
host:
- x64
target:
- x64
node:
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
include:
- os: windows-latest
node: 16
host: x86
target: x86
- os: macos-m1
node: 16
host: arm64
target: arm64
name: ${{ matrix.os }} (node=${{ matrix.node }}, host=${{ matrix.host }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.host }}

- name: Add yarn (self-hosted)
if: matrix.os == 'macos-m1'
run: npm install -g yarn

- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: contains(matrix.os, 'windows')
with:
msbuild-architecture: ${{ matrix.target }}

- name: Install dependencies
run: yarn install --ignore-scripts

- name: Add env vars
shell: bash
run: |
echo "V=1" >> $GITHUB_ENV
if [ "${{ matrix.target }}" = "x86" ]; then
echo "TARGET=ia32" >> $GITHUB_ENV
else
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
fi
- name: Add Linux env vars
if: contains(matrix.os, 'ubuntu')
run: |
echo "CFLAGS=${CFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
echo "CXXFLAGS=${CXXFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
- name: Configure build
run: yarn node-pre-gyp configure --target_arch=${{ env.TARGET }}

- name: Build binaries
run: yarn node-pre-gyp build --target_arch=${{ env.TARGET }}

- name: Print binary info
if: contains(matrix.os, 'ubuntu')
run: |
ldd lib/binding/*/node_sqlite3.node
echo "---"
nm lib/binding/*/node_sqlite3.node | grep "GLIBC_" | c++filt || true
echo "---"
file lib/binding/napi-v*/*
- name: Run tests
run: yarn test

- name: Package prebuilt binaries
run: yarn node-pre-gyp package --target_arch=${{ env.TARGET }}

- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v3
if: matrix.node == 16
with:
name: prebuilt-binaries
path: build/stage/*/*
retention-days: 7

- name: Upload binaries to GitHub Release
run: yarn node-pre-gyp-github publish
if: matrix.node == 16 && startsWith(github.ref, 'refs/tags/')
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ github.token }}
build-qemu:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
strategy:
fail-fast: false
matrix:
node:
- 16
target:
- linux/arm64
variant:
- bullseye
- alpine3.15
include:
# musl x64 builds
- target: linux/amd64
variant: alpine3.15
node: 16
name: ${{ matrix.variant }} (node=${{ matrix.node }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build binaries and test
run: |
docker buildx build \
--file ./tools/BinaryBuilder.Dockerfile \
--load \
--tag sqlite-builder \
--platform ${{ matrix.target }} \
--no-cache \
--build-arg VARIANT=${{ matrix.variant }} \
--build-arg NODE_VERSION=${{ matrix.node }} \
.
CONTAINER_ID=$(docker create -it sqlite-builder)
docker cp $CONTAINER_ID:/usr/src/build/build/ ./build
- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v3
if: matrix.node == 16
with:
name: prebuilt-binaries
path: build/stage/*/*
retention-days: 7

- name: Upload binaries to GitHub Release
run: yarn install --ignore-scripts && yarn node-pre-gyp-github publish
if: matrix.node == 16 && startsWith(github.ref, 'refs/tags/')
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ github.token }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ test/nw/app.nw
.dtps
local.env
.mason
.eslintrc.js
setup.sh
/build-tmp-napi-v3
/build-tmp-napi-v6
*.tgz
package-lock.json
yarn.lock
20 changes: 0 additions & 20 deletions .npmignore

This file was deleted.

Loading

0 comments on commit 8b9a48c

Please sign in to comment.