Release #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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@v4 | |
with: | |
fetch-depth: 0 | |
submodules: 'true' | |
token: ${{ secrets.GH_BOT_TOKEN }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
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@v4 | |
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 | |
sed -i -e "s@project.build.outputTimestamp>.*</project.build.outputTimestamp@project.build.outputTimestamp>\${git.commit.author.time}</project.build.outputTimestamp@g" pom.xml | |
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 |