From 59263d2e061e6e8b0287a21a47eb5975aa2f05d4 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 1 Dec 2023 13:53:27 -0600 Subject: [PATCH] Always update version, set up publish CI for js types --- .github/workflows/publish-ci.yml | 20 +++++++++++++--- RELEASE.md | 1 - web/client-api/types/build.gradle | 32 ++++---------------------- web/client-api/types/package-lock.json | 2 +- web/client-api/types/package.json | 2 +- 5 files changed, 23 insertions(+), 34 deletions(-) diff --git a/.github/workflows/publish-ci.yml b/.github/workflows/publish-ci.yml index debbeb3dde8..2f94fd7eb57 100644 --- a/.github/workflows/publish-ci.yml +++ b/.github/workflows/publish-ci.yml @@ -13,6 +13,7 @@ concurrency: jobs: publish: runs-on: ubuntu-22.04 + if: ${{ github.repository_owner == 'deephaven' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -39,6 +40,12 @@ jobs: .github/scripts/gradle-properties.sh >> gradle.properties cat gradle.properties + - name: Setup Node for deployment to npmjs + uses: actions/setup-node@v3 + with: + node-version-file: 'web/client-api/types/.nvmrc' + registry-url: 'https://registry.npmjs.org' + # TODO(deephaven-core#2614): Improve gradle/CI assemble and publishing of artifacts - name: Publish to Maven Local @@ -46,16 +53,16 @@ jobs: uses: burrunan/gradle-cache-action@v1 with: job-id: publish-local - arguments: server-netty-app:build server-jetty-app:build py-server:build py-embedded-server:build py-client:build publishToMavenLocal + arguments: server-netty-app:build server-jetty-app:build py-server:build py-embedded-server:build py-client:build web-client-api:types:typedoc publishToMavenLocal gradle-version: wrapper - - name: Publish + - name: Build all artifacts, publish to Sonatype for staging to Maven Central if: ${{ startsWith(github.ref, 'refs/heads/release/v') }} uses: burrunan/gradle-cache-action@v1 with: job-id: publish # We need to be explicit here about no parallelism to ensure we don't create disjointed staging repositories. - arguments: --no-parallel server-netty-app:build server-jetty-app:build py-server:build py-client:build py-embedded-server:build publish + arguments: --no-parallel server-netty-app:build server-jetty-app:build py-server:build py-client:build py-embedded-server:build web-client-api:types:typedoc publish gradle-version: wrapper env: ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.SONATYPE_USERNAME }} @@ -74,6 +81,7 @@ jobs: py/server/build/wheel/ py/embedded-server/build/wheel/ py/client/build/wheel/ + web/client-api/types/build/*.tgz - name: Publish deephaven-core to PyPi if: ${{ startsWith(github.ref, 'refs/heads/release/v') }} @@ -98,3 +106,9 @@ jobs: user: __token__ password: ${{ secrets.PYDEEPHAVEN_PYPI_TOKEN }} packages_dir: py/client/build/wheel/ + + - name: Publish @deephaven/jsapi-types to npmjs + if: ${{ startsWith(github.ref, 'refs/heads/release/v') }} + env: + NODE_AUTH_TOKEN: ${{ secrets.DEEPHAVENBOT_NPM_TOKEN }} + run: npm publish --tag latest web/client-api/types/build/deephaven-jsapi-types-*.tgz diff --git a/RELEASE.md b/RELEASE.md index cfe868cd742..7e7f9574b22 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -269,7 +269,6 @@ mention the version explicitly. These files are listed below: # gradle.properties R/rdeephaven/DESCRIPTION -web/client-api/types/package.json ``` This leaves the files "ready" for the next regular release, and also ensures any build done from diff --git a/web/client-api/types/build.gradle b/web/client-api/types/build.gradle index 3ab69949765..0b2ab5bf6fc 100644 --- a/web/client-api/types/build.gradle +++ b/web/client-api/types/build.gradle @@ -12,6 +12,10 @@ dependencies { // Apply our temporary convention until dhc hits 1.0.0 def npmVersion = '1.0.0-dev' + project.property('deephavenBaseVersion').toString().trim() +def preId = project.findProperty('npmPreid')// i.e. 'nightly' +if (preId) { + npmVersion += preId + new Date().format("yyyyMMdd") +} Docker.registerDockerTask(project, 'typedoc') { copyIn { @@ -56,31 +60,3 @@ Docker.registerDockerTask(project, 'typedoc') { into "$buildDir/" } } - -Docker.registerDockerTask(project, 'versionBump') { - copyIn { - from 'package.json' - from 'package-lock.json' - } - dockerfile { - from 'deephaven/node:local-build' - copyFile('.', '/project') - environmentVariable('VERSION', npmVersion) - runCommand('''set -eux; \\ - cd /project; \\ - npm version $VERSION; \\''') - } - parentContainers = [ Docker.registryTask(project, 'node') ] // deephaven/node - containerOutPath = '/project' - copyOut { - include 'package.json' - include 'package-lock.json' - - into layout.projectDirectory - preserve { - include '**' - exclude 'package.json' - exclude 'package-lock.json' - } - } -} diff --git a/web/client-api/types/package-lock.json b/web/client-api/types/package-lock.json index c197c7a439e..615ee99c9e1 100644 --- a/web/client-api/types/package-lock.json +++ b/web/client-api/types/package-lock.json @@ -1,6 +1,6 @@ { "name": "@deephaven/jsapi-types", - "version": "1.0.0-dev0.31.0", + "version": "0.0.0-dummy", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/web/client-api/types/package.json b/web/client-api/types/package.json index 9f9f69db32b..bfe7ce018c8 100644 --- a/web/client-api/types/package.json +++ b/web/client-api/types/package.json @@ -1,6 +1,6 @@ { "name": "@deephaven/jsapi-types", - "version": "1.0.0-dev0.31.0", + "version": "0.0.0-dummy", "description": "Deephaven JSAPI Types", "author": "Deephaven Data Labs LLC", "license": "Apache-2.0",