-
Notifications
You must be signed in to change notification settings - Fork 630
113 lines (110 loc) · 4.43 KB
/
Copy pathnightly.yml
File metadata and controls
113 lines (110 loc) · 4.43 KB
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
name: Nightly
on:
schedule:
# Build and publish nightly snapshot at 3:55pm every day
- cron: "55 15 * * *"
workflow_dispatch:
inputs:
pr:
description: "Pull request#"
required: false
env:
CHC_BRANCH: "main"
# CHC_VERSION: "0.9.0"
CH_VERSION: "25.3"
jobs:
nightly:
if: ${{ startsWith(github.repository, 'ClickHouse/') }}
name: "Build and Publish Nightly Snapshot"
runs-on: "ubuntu-latest"
timeout-minutes: 20
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{ env.CHC_BRANCH }}
- name: Check out PR
run: |
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \
origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr
if: github.event.inputs.pr != ''
- name: Install JDK and Maven
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: |
8
17
cache: 'maven'
- name: Setup Toolchain
shell: bash
run: |
mkdir -p $HOME/.m2 \
&& cat << EOF > $HOME/.m2/toolchains.xml
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>17</version>
</provides>
<configuration>
<jdkHome>${{ env.JAVA_HOME }}</jdkHome>
</configuration>
</toolchain>
</toolchains>
EOF
- name: Update Configuration
run: |
# find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ env.CHC_VERSION }}-SNAPSHOT|g' \
# -e 's|^\( <version>\).*\(</version>\)$|\1${{ env.CHC_VERSION }}-SNAPSHOT\2|' \
# -e 's|${parent.groupId}|com.clickhouse|g' -e 's|${project.parent.groupId}|com.clickhouse|g' '{}' \;
find . -type f -name "simplelogger.*" -exec rm -fv '{}' \;
- name: Release Snapshot
uses: samuelmeuli/action-maven-publish@v1
with:
maven_profiles: release
maven_args: -q --batch-mode -DclickhouseVersion=${{ env.CH_VERSION }}
server_id: central
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.SONATYPE_TOKEN_USER }}
nexus_password: ${{ secrets.SONATYPE_TOKEN }}
- name: Release R2DBC 0.9.1 Snapshot
uses: samuelmeuli/action-maven-publish@v1
with:
directory: clickhouse-r2dbc
maven_profiles: release
maven_args: -q --batch-mode -Dr2dbc-spi.version=0.9.1.RELEASE -DclickhouseVersion=${{ env.CH_VERSION }}
server_id: central
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.SONATYPE_TOKEN_USER }}
nexus_password: ${{ secrets.SONATYPE_TOKEN }}
# Tableau users install the latest JDBC driver manually, so a snapshot
# regression hits them with no connector release in between - trigger the
# TDVT suite in ClickHouse/connectors on every published snapshot.
# https://github.com/ClickHouse/connectors/issues/71
- name: Mint a token to dispatch into connectors
id: tdvt-token
if: success()
continue-on-error: true # a TDVT dispatch failure must never fail the publish
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.WORKFLOW_AUTH_PUBLIC_APP_ID }}
private-key: ${{ secrets.WORKFLOW_AUTH_PUBLIC_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "connectors"
- name: Trigger Tableau TDVT in connectors
if: success()
continue-on-error: true # a TDVT dispatch failure must never fail the publish
env:
GH_TOKEN: ${{ steps.tdvt-token.outputs.token }}
run: |
# The published snapshot version is the pom's <revision> property
# (env.CHC_VERSION is commented out above, so it can't be used here)
VERSION=$(sed -n 's|.*<revision>\(.*\)</revision>.*|\1|p' pom.xml | head -1)
echo "Dispatching TDVT for clickhouse-jdbc $VERSION"
gh api repos/ClickHouse/connectors/dispatches \
-f event_type=jdbc-snapshot \
-F "client_payload[jdbc_version]=$VERSION"