Skip to content

Commit 7b1c37f

Browse files
committed
feat(ci): add GitHub Actions workflow for release automation
- Introduced `.github/workflows/release.yml` for automated release workflow on `master` branch. - Removed sensitive logging from Gradle build script.
1 parent d187d67 commit 7b1c37f

2 files changed

Lines changed: 91 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
concurrency:
14+
group: release-master
15+
cancel-in-progress: false
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
21+
env:
22+
CLOUDERA_HMS_BASE_IMAGE: ghcr.io/openprojectx/postgres14-jdk17:latest
23+
CLOUDERA_HMS_IMAGE: ghcr.io/openprojectx/cloudera-hms
24+
GRADLE_OPTS: -Dorg.gradle.daemon=false
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
32+
33+
- name: Set up JDK 17
34+
uses: actions/setup-java@v4
35+
with:
36+
distribution: temurin
37+
java-version: '17'
38+
39+
- name: Set up Gradle
40+
uses: gradle/actions/setup-gradle@v4
41+
with:
42+
cache-read-only: false
43+
44+
- name: Cache Jib
45+
uses: actions/cache@v4
46+
with:
47+
path: |
48+
~/.cache/google-cloud-tools-java/jib
49+
~/.jib-cache
50+
key: ${{ runner.os }}-jib-${{ hashFiles('**/*.gradle.kts', '**/gradle.properties', 'gradle/libs.versions.toml') }}
51+
restore-keys: |
52+
${{ runner.os }}-jib-
53+
54+
- name: Configure git
55+
run: |
56+
git config user.name "github-actions[bot]"
57+
git config user.email "github-actions[bot]@users.noreply.github.com"
58+
59+
- name: Verify Docker environment
60+
run: |
61+
docker version
62+
docker info
63+
64+
- name: Log in to GHCR
65+
uses: docker/login-action@v3
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Write signing key
72+
env:
73+
SIGNING_KEY_ASC: ${{ secrets.SIGNING_KEY_ASC }}
74+
run: |
75+
printf '%s' "$SIGNING_KEY_ASC" > "$RUNNER_TEMP/signing-key.asc"
76+
77+
- name: Run Testcontainers verification
78+
env:
79+
CLOUDERA_HMS_IMAGE: cloudera-hms:test
80+
CLOUDERA_HMS_TEST_IMAGE: cloudera-hms:test
81+
run: |
82+
./gradlew :testcontainers:test
83+
84+
- name: Run release
85+
env:
86+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
87+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
88+
SIGNING_KEY_FILE: ${{ runner.temp }}/signing-key.asc
89+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
90+
run: |
91+
./gradlew release

build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,7 @@ nexusPublishing {
112112
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
113113
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
114114
username.set(System.getenv("OSSRH_USERNAME"))
115-
logger.info("using username: ${System.getenv("OSSRH_USERNAME")}")
116-
117115
password.set(System.getenv("OSSRH_PASSWORD"))
118-
logger.info("using password: ${System.getenv("OSSRH_PASSWORD")}")
119116

120117
}
121118
}

0 commit comments

Comments
 (0)