From 448a0f1dc68f88ffe1b2ec0c746ea602d64330b9 Mon Sep 17 00:00:00 2001 From: Will Scullin Date: Mon, 25 Mar 2024 15:11:21 -0700 Subject: [PATCH] WIP --- .github/workflows/db-bigquery.yaml | 2 +- .github/workflows/db-motherduck.yaml | 2 +- .github/workflows/db-postgres.yaml | 2 +- .github/workflows/db-snowflake.yaml | 2 +- .github/workflows/main.yaml | 2 +- .github/workflows/prerelease.yaml | 46 ++++++++++++++++++++++++++++ 6 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/prerelease.yaml diff --git a/.github/workflows/db-bigquery.yaml b/.github/workflows/db-bigquery.yaml index 12d1c3a82..ce706a0cf 100644 --- a/.github/workflows/db-bigquery.yaml +++ b/.github/workflows/db-bigquery.yaml @@ -1,6 +1,6 @@ name: BigQuery DB -on: [pull_request] +on: [pull_request, workflow_call] jobs: test-bigquery: diff --git a/.github/workflows/db-motherduck.yaml b/.github/workflows/db-motherduck.yaml index 7d0d4f580..5532dade3 100644 --- a/.github/workflows/db-motherduck.yaml +++ b/.github/workflows/db-motherduck.yaml @@ -1,6 +1,6 @@ name: MotherDuck DB -on: [pull_request] +on: [pull_request, workflow_call] jobs: test-motherduck: diff --git a/.github/workflows/db-postgres.yaml b/.github/workflows/db-postgres.yaml index bbecab194..9aa12bddf 100644 --- a/.github/workflows/db-postgres.yaml +++ b/.github/workflows/db-postgres.yaml @@ -1,6 +1,6 @@ name: Postgres DB -on: [pull_request] +on: [pull_request, workflow_call] jobs: # Label of the container job diff --git a/.github/workflows/db-snowflake.yaml b/.github/workflows/db-snowflake.yaml index c4e6b8438..e7226a733 100644 --- a/.github/workflows/db-snowflake.yaml +++ b/.github/workflows/db-snowflake.yaml @@ -1,6 +1,6 @@ name: Snowflake DB -on: [pull_request] +on: [pull_request, workflow_call] jobs: test-snowflake: diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 71b14ee37..713dd4e66 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,6 +1,6 @@ name: Core -on: [pull_request] +on: [pull_request, workflow_call] jobs: test-all: diff --git a/.github/workflows/prerelease.yaml b/.github/workflows/prerelease.yaml new file mode 100644 index 000000000..1bb621598 --- /dev/null +++ b/.github/workflows/prerelease.yaml @@ -0,0 +1,46 @@ +name: npmjs.com Pre-release + +on: [push] + +jobs: + db-bigquery: + uses: './.github/workflows/db-bigquery.yaml' + db-motherduck: + uses: './.github/workflows/db-motherduck.yaml' + db-postgres: + uses: './.github/workflows/db-postgres.yaml' + db-snowflake: + uses: './.github/workflows/db-snowflake.yaml' + main: + uses: './.github/workflows/main.yaml' + + npm-prerelease: + needs: + - db-bigquery + - db-motherduck + - db-postgres + - db-snowflake + - main + runs-on: ubuntu-latest + env: + PACKAGES: 'packages/malloy-interfaces packages/malloy packages/malloy-db-bigquery packages/malloy-db-duckdb packages/malloy-db-postgres packages/malloy-db-snowflake packages/malloy-db-trino packages/malloy-render packages/malloy-malloy-sql test packages/malloy-syntax-highlight' + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.x + - name: npm install, build, and publish + run: | + npm ci --loglevel error + npm run build + echo Publishing \$PACKAGES + PRERELEASE=\$(date +%y%m%d%H%M%S) + VERSION=\$(jq -r .version ./lerna.json)-dev\$PRERELEASE + npx lerna version \$VERSION --yes --no-push --no-git-tag-version + for package in \$PACKAGES; do + echo Publishing \$package \$VERSION + npm publish --dry-run -w \$package --access=public --tag next + done