Skip to content

Commit

Permalink
fix(gha): release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rbioteau committed Dec 3, 2024
1 parent 09b1bfe commit 9c07c7c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 17

- name: Configure Git user
run: |
Expand Down
45 changes: 22 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,41 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The version of the release. Used as tag name.'
required: true
default: 'x.y.z'
description: Version to release (leave empty to use pom version)
type: string
default: ''
required: false
nextVersion:
description: 'Next development version (leave empty to use default version incrementation policy)'
type: string
required: false
default: ''
skipMergeReleaseInMaster:
description: 'Whether release branch merge should be skip into master (major/minor version only should be merged)'
type: boolean
required: false
default: false

jobs:
build:
name: Release pipeline
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.gpg_private_key }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase


- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Build Release
run: ./mvnw --batch-mode release:prepare -DreleaseVersion=${{ github.event.inputs.version }}


- name: Publish
env:
MAVEN_USERNAME: ${{ secrets.ossrh_username }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.ossrh_password }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
run: mvn --batch-mode release:perform
- name: Create Release
run: ./mvnw -ntp --batch-mode -Dstyle.color=always gitflow:release -DgitFlowConfig.developmentBranch=${{ github.ref_name }} -DdevelopmentVersion=${{ github.event.inputs.nextVersion }} -DreleaseVersion=${{ github.event.inputs.version }} -DskipReleaseMergeProdBranch=${{ github.event.inputs.skipMergeReleaseInMaster }} -Dverbose

0 comments on commit 9c07c7c

Please sign in to comment.