Skip to content

Commit

Permalink
Always update version, set up publish CI for js types
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Dec 1, 2023
1 parent cfba8dc commit 59263d2
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 34 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/publish-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:
jobs:
publish:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'deephaven' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -39,23 +40,29 @@ 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
if: ${{ !startsWith(github.ref, 'refs/heads/release/v') }}
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 }}
Expand All @@ -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') }}
Expand All @@ -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
1 change: 0 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 4 additions & 28 deletions web/client-api/types/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
}
}
}
2 changes: 1 addition & 1 deletion web/client-api/types/package-lock.json

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

2 changes: 1 addition & 1 deletion web/client-api/types/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 59263d2

Please sign in to comment.