-
Notifications
You must be signed in to change notification settings - Fork 534
84 lines (79 loc) · 2.87 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
default: "0.7.1-SNAPSHOT"
env:
CH_VERSION: "24.8"
jobs:
release:
name: "Build and Publish Artifact"
runs-on: "ubuntu-latest"
permissions: write-all
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- 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}|${{ github.event.inputs.version }}|g' \
-e 's|^\( <version>\).*\(</version>\)$|\1${{ github.event.inputs.version }}\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 Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
maven_profiles: release
maven_args: -q --batch-mode -DclickhouseVersion=${{ env.CH_VERSION }}
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
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 }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.SONATYPE_TOKEN_USER }}
nexus_password: ${{ secrets.SONATYPE_TOKEN }}
- name: Create Pre-release on Github
uses: "zhicwu/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v${{ github.event.inputs.version }}"
prerelease: true
title: "Release v${{ github.event.inputs.version }}"
files: |
LICENSE
**/target/clickhouse*.jar