From ffe47a13d45c9828f7aa19f5c4ffbde1bf58f5f6 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 | 7 +++- .github/workflows/db-motherduck.yaml | 7 +++- .github/workflows/db-postgres.yaml | 2 +- .github/workflows/db-snowflake.yaml | 9 ++++- .github/workflows/main.yaml | 2 +- .github/workflows/prerelease.yaml | 53 ++++++++++++++++++++++++++++ lerna.json | 2 +- 7 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/prerelease.yaml diff --git a/.github/workflows/db-bigquery.yaml b/.github/workflows/db-bigquery.yaml index 12d1c3a82..7b65be1b2 100644 --- a/.github/workflows/db-bigquery.yaml +++ b/.github/workflows/db-bigquery.yaml @@ -1,6 +1,11 @@ name: BigQuery DB -on: [pull_request] +on: + pull_request: + workflow_call: + secrets: + BIGQUERY_KEY: + required: true jobs: test-bigquery: diff --git a/.github/workflows/db-motherduck.yaml b/.github/workflows/db-motherduck.yaml index 7d0d4f580..62c207bd2 100644 --- a/.github/workflows/db-motherduck.yaml +++ b/.github/workflows/db-motherduck.yaml @@ -1,6 +1,11 @@ name: MotherDuck DB -on: [pull_request] +on: + pull_request: + workflow_call: + secrets: + MOTHERDUCK_TOKEN: + required: true 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..e4649bf26 100644 --- a/.github/workflows/db-snowflake.yaml +++ b/.github/workflows/db-snowflake.yaml @@ -1,6 +1,13 @@ name: Snowflake DB -on: [pull_request] +on: + pull_request: + workflow_call: + secrets: + SNOWFLAKE_USER: + required: true + SNOWFLAKE_PASSWORD: + required: true 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..9c0e87190 --- /dev/null +++ b/.github/workflows/prerelease.yaml @@ -0,0 +1,53 @@ +name: npmjs.com Pre-release + +on: [push] + +jobs: + # db-bigquery: + # uses: './.github/workflows/db-bigquery.yaml' + # secrets: + # BIGQUERY_KEY: ${{ secrets.BIGQUERY_KEY }} + # db-motherduck: + # uses: './.github/workflows/db-motherduck.yaml' + # secrets: + # MOTHERDUCK_TOKEN: ${{ secrets.MOTHERDUCK_TOKEN }} + # db-postgres: + # uses: './.github/workflows/db-postgres.yaml' + # db-snowflake: + # uses: './.github/workflows/db-snowflake.yaml' + # secrets: + # SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }} + # SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }} + 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 diff --git a/lerna.json b/lerna.json index 05b985df5..891775a42 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ "version": "0.0.135", "command": { "version": { - "allowBranch": "main" + "allowBranch": "whscullin/pre-release-action" } } }