From ccc71fc1933d9d3d5bff85fd7015b3dec67ef2ae Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Tue, 14 Mar 2023 16:36:31 +0100 Subject: [PATCH] add a post-publish package test --- .github/workflows/npm.yml | 28 ++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..d9e2bef --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,28 @@ +name: Test npm package + +on: + workflow_dispatch: + inputs: + version: + description: 'Package version to test' + required: true + +jobs: + integration: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + - run: npm ci + - run: npm run build + - name: Run headless test + uses: GabrielBB/xvfb-action@v1 + env: + SQLITE_INSTALL_CMD: npm install sqlite-wasm-http@${{ github.event.inputs.version }} + with: + run: npm test diff --git a/package.json b/package.json index c0061e0..ab0afe3 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "publish": "npm run publish:shared && npm run publish:gh", "preversion": "npm test", "version": "npm run build && npm run doc && git add package.json docs", - "postversion": "git push && git push --tags && npm run publish" + "postversion": "git push && git push --tags && npm run publish", + "postpublish": "gh workflow run npm.yml -F version=$npm_package_version" }, "repository": { "type": "git",