Nightly #1574
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.8" | |
| jobs: | |
| nightly: | |
| if: ${{ startsWith(github.repository, 'ClickHouse/') }} | |
| name: "Build and Publish Nightly Snapshot" | |
| runs-on: "ubuntu-latest" | |
| timeout-minutes: 20 | |
| outputs: | |
| jdbc_version: ${{ steps.publish-version.outputs.jdbc_version }} | |
| 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: Record published snapshot version | |
| id: publish-version | |
| run: | | |
| VERSION=$(sed -n 's|.*<revision>\(.*\)</revision>.*|\1|p' pom.xml | head -1) | |
| echo "Published snapshot version: $VERSION" | |
| echo "jdbc_version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - 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 }} | |
| # Mirror Tableau TDVT after publish (non-blocking). | |
| tdvt: | |
| name: "Tableau TDVT" | |
| needs: nightly | |
| if: ${{ needs.nightly.result == 'success' && startsWith(github.repository, 'ClickHouse/') }} | |
| runs-on: "ubuntu-latest" | |
| timeout-minutes: 150 # the TDVT matrix (latest/head/cloud, single-threaded) runs ~1h; allow for a queue | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Mint a token for the TDVT repo (dispatch + read the run) | |
| id: tdvt-token | |
| 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: "clickhouse-tableau-tdvt" | |
| - name: Run Tableau TDVT and mirror its result | |
| env: | |
| GH_TOKEN: ${{ steps.tdvt-token.outputs.token }} | |
| run: | | |
| python3 .github/scripts/mirror_tdvt.py \ | |
| --event-type jdbc-snapshot \ | |
| --version "${{ needs.nightly.outputs.jdbc_version }}" \ | |
| --correlation-id "${{ github.repository }}#${{ github.run_id }}-${{ github.run_attempt }}" |