Skip to content

Commit c5f922e

Browse files
benipeledroydahan
authored andcommitted
ci: add github-workflow for CI release
This commit adds a new github-workflow to automate the release process for the scylladb java driver, This is the first stage of automation, including building and pushing the project to the staging repository, which requires manual promotion for the version, The last step of promoting from staging to production (nexus OSS) will be automated later, as I need to investigate an issue with the nexus-staging:release command
1 parent f368a53 commit c5f922e

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release ScyllaDB Java Driver
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dryrun:
7+
type: boolean
8+
description: 'dryrun: run without pushing SCM changes to upstream'
9+
default: true
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-22.04
15+
16+
permissions:
17+
contents: write
18+
19+
env:
20+
MVNCMD: mvn -B -X -ntp
21+
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v3
25+
26+
- name: Set up Java
27+
uses: actions/setup-java@v3
28+
with:
29+
java-version: '8'
30+
distribution: 'adopt'
31+
server-id: ossrh
32+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
33+
server-username: OSSRH_USERNAME
34+
server-password: OSSRH_PASSWORD
35+
36+
- name: Configure Git user
37+
run: |
38+
git config user.name "ScyllaDB Promoter"
39+
git config user.email "github-promoter@scylladb.com"
40+
41+
- name: Clean project
42+
run: $MVNCMD clean
43+
44+
- name: Clean release
45+
run: $MVNCMD release:clean
46+
47+
- name: Prepare release
48+
env:
49+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
50+
run: $MVNCMD release:prepare -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
51+
52+
- name: Perform release
53+
env:
54+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
55+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
56+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
57+
run: $MVNCMD release:perform -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
58+
59+
- name: Push changes to SCM
60+
if: ${{ github.event.inputs.dryrun == 'false' }}
61+
run: |
62+
git status && git log -3
63+
git push origin --follow-tags -v

0 commit comments

Comments
 (0)