Skip to content

Commit

Permalink
fix: Clean up publish action (#244)
Browse files Browse the repository at this point in the history
Only perform linto on CI (drop lint-skypack)
Add publish support to release-please
Bump versions

Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
  • Loading branch information
GordonSmith authored Aug 14, 2024
1 parent 55a2969 commit 6533b06
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 40 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,74 @@ jobs:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

- name: Checkout Sources
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4

- name: Install NodeJS
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
scope: "@hpcc-js"

- name: Install OS Dependencies
if: ${{ steps.release.outputs.release_created }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y git cmake ninja-build wget zip
sudo apt-get install -y gcc-multilib g++-multilib pkg-config autoconf bison libtool flex
sudo apt-get install -y python3 python3-pip
sudo apt-get install -y chromium
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Dependencies
if: ${{ steps.release.outputs.release_created }}
run: |
npm ci
npm run install-build-deps
- name: Build
if: ${{ steps.release.outputs.release_created }}
run: |
npm run build
- name: Test
if: ${{ steps.release.outputs.release_created }}
env:
CI: true
run: |
npm run test
- name: Calculate Coverage
if: ${{ steps.release.outputs.release_created }}
run: |
npm run coverage
npm run coverage-report
- name: Update Coveralls
if: ${{ steps.release.outputs.release_created }}
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
npm publish
- name: Purge jsdelivr
if: ${{ steps.release.outputs.release_created }}
run: |
npm run purge-jsdelivr
27 changes: 2 additions & 25 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test-and-publish
name: Test PR

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
Expand Down Expand Up @@ -63,30 +63,7 @@ jobs:
npm run test
- name: Calculate Coverage
if: ${{ matrix.node == 20 }}
run: |
npm run coverage
npm run coverage-report
- name: Update Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
if: github.ref_type == 'tag'
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
npm publish ${{ contains(github.ref, 'next') && '--tag next' || '' }}
- name: Purge jsdelivr
if: github.ref_type == 'tag'
run: |
npm run purge-jsdelivr
- name: Create Release
if: github.ref_type == 'tag'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: ${{ contains(github.ref, '-next.') }}
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"git-push": "git push --follow-tags upstream trunk",
"serve-docs": "vitepress serve docs",
"serve": "ws",
"lint-skypack": "lerna run lint-skypack",
"lint": "lerna run lint",
"lint-fix": "npm run lint -- --fix",
"test-node": "lerna run test-node",
Expand Down Expand Up @@ -102,7 +103,7 @@
"run-script-os": "1.1.6",
"tslib": "2.6.3",
"typedoc": "0.26.5",
"typedoc-plugin-markdown": "4.2.3",
"typedoc-plugin-markdown": "4.2.4",
"typescript": "5.5.4",
"typescript-eslint": "8.1.0",
"vitepress": "1.3.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/base91/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "run-p build-types build-ts",
"lint-skypack": "npx -y @skypack/package-check",
"lint-eslint": "eslint src/**/*.ts",
"lint": "run-p lint-eslint lint-skypack",
"lint": "run-p lint-eslint",
"test-chrome": "karma start --single-run --browsers ChromiumHeadless karma.conf.cjs",
"test-firefox": "karma start --single-run --browsers Firefox karma.conf.cjs",
"test-node": "nyc mocha ./dist-test/index.node.js --reporter spec",
Expand Down
2 changes: 1 addition & 1 deletion packages/duckdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"build": "npm-run-all --serial pack-duckdb --parallel build-types build-ts",
"lint-skypack": "npx -y @skypack/package-check",
"lint-eslint": "eslint src/**/*.ts",
"lint": "run-p lint-eslint lint-skypack",
"lint": "run-p lint-eslint",
"test-chrome": "karma start --single-run --browsers ChromiumHeadless karma.conf.cjs",
"test-firefox": "karma start --single-run --browsers Firefox karma.conf.cjs",
"test": "run-s test-chrome"
Expand Down
1 change: 1 addition & 0 deletions packages/duckdb/test/duckdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { expect } from "chai";
import { DuckDB } from "@hpcc-js/wasm-duckdb";

describe("duckdb", function () {
this.timeout(5000);
it("version", async function () {
const duckdb = await DuckDB.load();
const v = duckdb.version();
Expand Down
2 changes: 1 addition & 1 deletion packages/expat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "run-p build-types build-ts",
"lint-skypack": "npx -y @skypack/package-check",
"lint-eslint": "eslint src/**/*.ts",
"lint": "run-p lint-eslint lint-skypack",
"lint": "run-p lint-eslint",
"test-chrome": "karma start --single-run --browsers ChromiumHeadless karma.conf.cjs",
"test-firefox": "karma start --single-run --browsers Firefox karma.conf.cjs",
"test-node": "mocha ./dist-test/index.node.js --reporter spec",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphviz-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"build": "run-p build-types build-ts",
"lint-skypack": "npx -y @skypack/package-check",
"lint-eslint": "eslint src/**/*.ts",
"lint": "run-p lint-eslint lint-skypack"
"lint": "run-p lint-eslint"
},
"dependencies": {
"@hpcc-js/wasm-graphviz": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphviz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "run-p build-types build-ts",
"lint-skypack": "npx -y @skypack/package-check",
"lint-eslint": "eslint src/**/*.ts",
"lint": "run-p lint-eslint lint-skypack",
"lint": "run-p lint-eslint",
"test-chrome": "karma start --single-run --browsers ChromiumHeadless karma.conf.cjs",
"test-firefox": "karma start --single-run --browsers Firefox karma.conf.cjs",
"test-node": "mocha ./dist-test/index.node.js --reporter spec",
Expand Down
2 changes: 1 addition & 1 deletion packages/wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"build": "run-p build-types build-ts",
"lint-skypack": "npx -y @skypack/package-check",
"lint-eslint": "eslint src/**/*.ts",
"lint": "run-p lint-eslint lint-skypack",
"lint": "run-p lint-eslint",
"test-chrome": "karma start --single-run --browsers ChromiumHeadless karma.conf.cjs",
"test-firefox": "karma start --single-run --browsers Firefox karma.conf.cjs",
"test-node": "mocha ./dist-test/index.node.js --reporter spec",
Expand Down
2 changes: 1 addition & 1 deletion packages/zstd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "run-p build-types build-ts",
"lint-skypack": "npx -y @skypack/package-check",
"lint-eslint": "eslint src/**/*.ts",
"lint": "run-p lint-eslint lint-skypack",
"lint": "run-p lint-eslint",
"test-chrome": "karma start --single-run --browsers ChromiumHeadless karma.conf.cjs",
"test-firefox": "karma start --single-run --browsers Firefox karma.conf.cjs",
"test-node": "mocha ./dist-test/index.node.js --reporter spec",
Expand Down

0 comments on commit 6533b06

Please sign in to comment.