Skip to content

Commit

Permalink
Release workflow for 4.x branch
Browse files Browse the repository at this point in the history
Backport of 3.x version (#303)
  • Loading branch information
Bouncheck committed Jun 19, 2024
1 parent 87ba8b6 commit 7e3ba7c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release ScyllaDB Java Driver

on:
workflow_dispatch:
inputs:
dryrun:
type: boolean
description: 'dryrun: run without pushing SCM changes to upstream'
default: true

jobs:
release:
name: Release
runs-on: ubuntu-22.04

permissions:
contents: write

env:
MVNCMD: mvn -B -X -ntp

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
server-id: ossrh
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD

- name: Configure Git user
run: |
git config user.name "ScyllaDB Promoter"
git config user.email "[email protected]"
- name: Clean project
run: $MVNCMD clean

- name: Clean release
run: $MVNCMD release:clean

- name: Prepare release
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: $MVNCMD release:prepare -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}

- name: Perform release
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
if: ${{ github.event.inputs.dryrun == 'false' }}
run: $MVNCMD release:perform -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}

- name: Push changes to SCM
if: ${{ github.event.inputs.dryrun == 'false' }}
run: |
git status && git log -3
git push origin --follow-tags -v
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<graalapi.version>22.0.0.2</graalapi.version>
<skipTests>false</skipTests>
<skipUnitTests>${skipTests}</skipUnitTests>
<pushChanges>false</pushChanges>
</properties>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -537,6 +538,9 @@
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<deployAtEnd>true</deployAtEnd>
</configuration>
<executions>
<execution>
<id>default-deploy</id>
Expand Down Expand Up @@ -847,7 +851,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals-->
<pushChanges>true</pushChanges>
<localCheckout>true</localCheckout>
<pushChanges>${pushChanges}</pushChanges>
<mavenExecutorId>forked-path</mavenExecutorId>
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
<!-- Our integration tests are too long to run during a release, we run them in CI -->
Expand Down

0 comments on commit 7e3ba7c

Please sign in to comment.