-
Notifications
You must be signed in to change notification settings - Fork 81
166 lines (143 loc) · 6.58 KB
/
publish-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Publish CI
on:
push:
branches: [ 'main', 'release/v*' ]
pull_request:
branches: [ 'main', 'rc/v*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-24.04
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 11
id: setup-java-11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Setup JDK 17
id: setup-java-17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Set JAVA_HOME
run: echo "JAVA_HOME=${{ steps.setup-java-11.outputs.path }}" >> $GITHUB_ENV
- name: Setup gradle properties
run: |
.github/scripts/gradle-properties.sh >> gradle.properties
cat gradle.properties
- name: Setup Node for deployment to npmjs
uses: actions/setup-node@v4
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: Build all artifacts, publish to Maven Local
if: ${{ !startsWith(github.ref, 'refs/heads/release/v') }}
run: ./gradlew server-netty-app:build server-jetty-app:build py-server:build py-embedded-server:build py-client:build py-client-ticking:build web-client-api:types:build publishToMavenLocal
- name: Build all artifacts, publish to Sonatype for staging to Maven Central
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
# We need to be explicit here about no parallelism to ensure we don't create disjointed staging repositories.
run: ./gradlew --no-parallel server-netty-app:build server-jetty-app:build py-server:build py-embedded-server:build py-client:build py-client-ticking:build web-client-api:types:build publish
env:
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.CI_AT_DEEPHAVEN_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.CI_AT_DEEPHAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingRequired: true
- name: Upload Artifacts
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
server/jetty-app/build/distributions/
py/server/build/wheel/
py/embedded-server/build/wheel/
py/client/build/wheel/
py/client-ticking/build/wheel/
web/client-api/types/build/*.tgz
- name: Publish deephaven-core to PyPi
id: publish-deephaven-core
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: py/server/build/wheel/
continue-on-error: true
- name: Publish deephaven-server to PyPi
id: publish-deephaven-server
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: py/embedded-server/build/wheel/
continue-on-error: true
- name: Publish pydeephaven to PyPi
id: publish-pydeephaven
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: py/client/build/wheel/
continue-on-error: true
- name: Publish pydeephaven-ticking to PyPi
id: publish-pydeephaven-ticking
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: py/client-ticking/build/wheel/
continue-on-error: true
- name: Publish @deephaven/jsapi-types to npmjs
id: publish-deephaven-jsapi-types
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
env:
NODE_AUTH_TOKEN: ${{ secrets.DEEPHAVENBOT_NPM_TOKEN }}
run: npm publish --provenance --tag latest web/client-api/types/build/deephaven-jsapi-types-*.tgz
continue-on-error: true
- uses: slackapi/[email protected]
if: ${{ steps.publish-deephaven-core.outcome == 'failure' }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PUBLISH_FAILURE }}
webhook-type: webhook-trigger
payload: |
step_id: "${{ steps.publish-deephaven-core.id }}"
action_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- uses: slackapi/[email protected]
if: ${{ steps.publish-deephaven-server.outcome == 'failure' }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PUBLISH_FAILURE }}
webhook-type: webhook-trigger
payload: |
step_id: "${{ steps.publish-deephaven-server.id }}"
action_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- uses: slackapi/[email protected]
if: ${{ steps.publish-pydeephaven.outcome == 'failure' }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PUBLISH_FAILURE }}
webhook-type: webhook-trigger
payload: |
step_id: "${{ steps.publish-pydeephaven.id }}"
action_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- uses: slackapi/[email protected]
if: ${{ steps.publish-pydeephaven-ticking.outcome == 'failure' }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PUBLISH_FAILURE }}
webhook-type: webhook-trigger
payload: |
step_id: "${{ steps.publish-pydeephaven-ticking.id }}"
action_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- uses: slackapi/[email protected]
if: ${{ steps.publish-deephaven-jsapi-types.outcome == 'failure' }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PUBLISH_FAILURE }}
webhook-type: webhook-trigger
payload: |
step_id: "${{ steps.publish-deephaven-jsapi-types.id }}"
action_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"