Skip to content

Release

Release #22

Workflow file for this run

---
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
env:
JAVA_VERSION: '11'
JAVA_DISTRO: 'zulu'
USER_EMAIL: 'cdevents@cd.foundation'
USER_NAME: 'CDEvents Bot'
USER_ID: 'cdevents-bot'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
token: ${{ secrets.GH_BOT_TOKEN }}
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
cache: maven
- name: Set Version
run: |
VERSION=${{ github.event.inputs.version }}
echo "Updating POMs to version $VERSION"
./mvnw -ntp -B versions:set versions:commit -DnewVersion=$VERSION
git config --global user.email "${{ env.USER_EMAIL }}"
git config --global user.name "${{ env.USER_NAME }}"
git commit -a -s -m "Releasing version $VERSION"
git push
- name: Stage deploy
run: |
./mvnw -ntp -B --file pom.xml -Ppublication
- name: Release
run: |
./mvnw -ntp -B --file pom.xml -Prelease -pl :cdevents-sdk-java-parent
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
JRELEASER_NEXUS2_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v3
with:
name: jreleaser-release
path: |
target/jreleaser/trace.log
target/jreleaser/output.properties
- name: Bump to snapshot
run: |
./mvnw -ntp -B versions:set versions:commit -DnextSnapshot=true
git config --global user.email "${{ env.USER_EMAIL }}"
git config --global user.name "${{ env.USER_NAME }}"
git commit -a -s -m "Bump version to next snapshot"
git push