Skip to content

Commit 7e3ba7c

Browse files
committed
Release workflow for 4.x branch
Backport of 3.x version (#303)
1 parent 87ba8b6 commit 7e3ba7c

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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 "[email protected]"
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+
if: ${{ github.event.inputs.dryrun == 'false' }}
58+
run: $MVNCMD release:perform -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
59+
60+
- name: Push changes to SCM
61+
if: ${{ github.event.inputs.dryrun == 'false' }}
62+
run: |
63+
git status && git log -3
64+
git push origin --follow-tags -v

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
<graalapi.version>22.0.0.2</graalapi.version>
9696
<skipTests>false</skipTests>
9797
<skipUnitTests>${skipTests}</skipUnitTests>
98+
<pushChanges>false</pushChanges>
9899
</properties>
99100
<dependencyManagement>
100101
<dependencies>
@@ -537,6 +538,9 @@
537538
<plugin>
538539
<artifactId>maven-deploy-plugin</artifactId>
539540
<version>2.8.2</version>
541+
<configuration>
542+
<deployAtEnd>true</deployAtEnd>
543+
</configuration>
540544
<executions>
541545
<execution>
542546
<id>default-deploy</id>
@@ -847,7 +851,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
847851
<!-- useReleaseProfile>false</useReleaseProfile>
848852
<releaseProfiles>release</releaseProfiles>
849853
<goals>deploy</goals-->
850-
<pushChanges>true</pushChanges>
854+
<localCheckout>true</localCheckout>
855+
<pushChanges>${pushChanges}</pushChanges>
851856
<mavenExecutorId>forked-path</mavenExecutorId>
852857
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
853858
<!-- Our integration tests are too long to run during a release, we run them in CI -->

0 commit comments

Comments
 (0)