Skip to content

Commit

Permalink
NPM CI (#921)
Browse files Browse the repository at this point in the history
Enable automatic development npm deployments on merge to main.
  • Loading branch information
Will Scullin authored Nov 8, 2022
1 parent cff296c commit 83299c9
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 81 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
9 changes: 0 additions & 9 deletions cloudbuild/build-test/package-extension.sh

This file was deleted.

17 changes: 7 additions & 10 deletions cloudbuild/deploy/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
steps:
- id: deploy-marketplace
- id: deploy-npm
name: "nixos/nix"
entrypoint: sh
args:
- -c
- "./cloudbuild/deploy/$TRIGGER_NAME.sh"
timeout: "1600s"
secretEnv: ["VSCE_PAT", "GA_API_SECRET", "GA_MEASUREMENT_ID"]
logsBucket: "gs://malloy-cloudbuild-logs"
timeout: "1600s"
secretEnv: ["NPM_TOKEN"]
options:
logging: CLOUD_LOGGING_ONLY
timeout: "1800s"
availableSecrets:
secretManager:
- versionName: projects/malloy-303216/secrets/marketplace-prerelease-CI/versions/latest
env: "VSCE_PAT"
- versionName: projects/malloy-303216/secrets/vscode-extension-CI-GA-API-SECRET/versions/latest
env: "GA_API_SECRET"
- versionName: projects/malloy-303216/secrets/vscode-extension-CI-GA-MEASUREMENT-ID/versions/latest
env: "GA_MEASUREMENT_ID"
- versionName: projects/malloy-303216/secrets/npm-publish/versions/latest
env: "NPM_TOKEN"
9 changes: 0 additions & 9 deletions cloudbuild/deploy/deploy-patch-extension.sh

This file was deleted.

12 changes: 0 additions & 12 deletions cloudbuild/deploy/deploy-prerelease-extension.sh

This file was deleted.

20 changes: 20 additions & 0 deletions cloudbuild/deploy/malloy-npm-publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euxo pipefail

export PACKAGES="packages/malloy packages/malloy-db-bigquery packages/malloy-db-duckdb packages/malloy-db-postgres packages/malloy-render"

nix-shell --pure --keep NPM_TOKEN --keep PACKAGES --command "$(cat <<NIXCMD
set -euxo pipefail
cd /workspace
npm --no-audit --no-fund ci --loglevel error
npm run build
echo Publishing \$PACKAGES
PRERELEASE=\$(date +%y%m%d%H%M%S)
for package in \$PACKAGES; do
VERSION=\$(jq -r .version \$package/package.json)
echo Publishing \$package \$VERSION-\$PRERELEASE
npm version -w \$package \$VERSION-\$PRERELEASE
npm publish -w \$package --tag next
done
NIXCMD
)"
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
with import <nixpkgs> {}; stdenv.mkDerivation { name = "malloy"; buildInputs = [ nodejs-16_x jdk8 google-cloud-sdk postgresql ruby.devEnv git fakeroot]; }
with import <nixpkgs> {}; stdenv.mkDerivation { name = "malloy"; buildInputs = [ nodejs-16_x jdk8 google-cloud-sdk postgresql ruby.devEnv git jq fakeroot]; }
48 changes: 24 additions & 24 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
},
"devDependencies": {
"@jest/globals": "^26.6.2",
"@malloydata/db-bigquery": "0.0.5",
"@malloydata/malloy": "0.0.5",
"@malloydata/render": "0.0.5",
"@malloydata/db-bigquery": "0.0.6",
"@malloydata/malloy": "0.0.6",
"@malloydata/render": "0.0.6",
"@types/archiver": "^5.3.1",
"@types/fs-extra": "^9.0.13",
"@types/jest-expect-message": "^1.0.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/malloy-db-bigquery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@malloydata/db-bigquery",
"version": "0.0.5",
"version": "0.0.6",
"license": "GPL-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -20,7 +20,7 @@
"dependencies": {
"@google-cloud/bigquery": "^5.5.0",
"@google-cloud/common": "^3.6.0",
"@malloydata/malloy": "^0.0.5",
"@malloydata/malloy": "0.0.6",
"gaxios": "^4.2.0"
}
}
4 changes: 2 additions & 2 deletions packages/malloy-db-duckdb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@malloydata/db-duckdb",
"version": "0.0.5",
"version": "0.0.6",
"license": "GPL-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -19,7 +19,7 @@
},
"dependencies": {
"@duckdb/duckdb-wasm": "^1.17.0",
"@malloydata/malloy": "^0.0.5",
"@malloydata/malloy": "0.0.6",
"duckdb": "0.5.1"
}
}
4 changes: 2 additions & 2 deletions packages/malloy-db-postgres/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@malloydata/db-postgres",
"version": "0.0.5",
"version": "0.0.6",
"license": "GPL-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -18,7 +18,7 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@malloydata/malloy": "^0.0.5",
"@malloydata/malloy": "0.0.6",
"@types/pg": "^8.6.1",
"pg": "^8.7.1",
"pg-query-stream": "4.2.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/malloy-render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@malloydata/render",
"version": "0.0.5",
"version": "0.0.6",
"license": "GPL-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -17,7 +17,7 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@malloydata/malloy": "^0.0.5",
"@malloydata/malloy": "0.0.6",
"us-atlas": "^3.0.0",
"vega": "^5.21.0",
"vega-lite": "^5.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@malloydata/malloy",
"version": "0.0.5",
"version": "0.0.6",
"license": "GPL-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"malloyc": "ts-node ../scripts/malloy-to-json"
},
"dependencies": {
"@malloydata/malloy": "0.0.5",
"@malloydata/db-bigquery": "0.0.5",
"@malloydata/db-postgres": "0.0.5",
"@malloydata/db-duckdb": "0.0.5"
"@malloydata/malloy": "0.0.6",
"@malloydata/db-bigquery": "0.0.6",
"@malloydata/db-postgres": "0.0.6",
"@malloydata/db-duckdb": "0.0.6"
}
}

0 comments on commit 83299c9

Please sign in to comment.