Skip to content

Merge pull request #14 from MoshPe/MoshPe-patch-1 #7

Merge pull request #14 from MoshPe/MoshPe-patch-1

Merge pull request #14 from MoshPe/MoshPe-patch-1 #7

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
environment: MavenCentralDeploy
permissions:
contents: write # needed to create GitHub Release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
server-id: central
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Set release version from tag
run: |
VERSION=${GITHUB_REF_NAME#v}
mvn versions:set -DnewVersion=${VERSION} -DgenerateBackupPoms=false -N
- name: Build and publish streamfence-core to Maven Central
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
mvn -pl streamfence-core \
--no-transfer-progress \
clean deploy \
-DskipTests
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: StreamFence ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
generate_release_notes: true
- name: Bump to next SNAPSHOT on main
run: |
VERSION=${GITHUB_REF_NAME#v}
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))-SNAPSHOT"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin main
git checkout main
mvn versions:set -DnewVersion=${NEXT} -DgenerateBackupPoms=false -N
git add pom.xml
git commit -m "chore: bump version to ${NEXT} [skip ci]"
git push origin main