Push release to Maven repo #10
Workflow file for this run
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: Push release to Maven repo | |
permissions: | |
# contents permission to update benchmark contents in gh-pages branch | |
contents: write | |
on: | |
workflow_dispatch: | |
inputs: | |
release-version: | |
description: 'Version to be released (e.g. 0.12.13).' | |
required: true | |
next-snapshot-version: | |
description: 'Version to be set after the release (e.g. 0.12.14-SNAPSHOT).' | |
required: true | |
env: | |
GIT_AUTHOR_NAME: Github Actions Release bot | |
GIT_AUTHOR_EMAIL: <> | |
GIT_COMMITTER_NAME: Github Actions Release bot | |
GIT_COMMITTER_EMAIL: <> | |
jobs: | |
build_macos_rust_libs: | |
name: Build native library for MacOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'adopt' | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v3 | |
- name: Deploy package | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: rust-deploy | |
- name: "Upload Rust Static lib" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "macos-latest-libs" | |
path: ./fluvio/libs/ | |
retention-days: 5 | |
do-release-publish: | |
name: Push release to Sonatype OSS | |
needs: [build_macos_rust_libs] | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'infinyon' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Java and credentials | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'adopt' | |
- name: Download MacOS Lib | |
uses: actions/download-artifact@v4 | |
with: | |
name: "macos-latest-libs" | |
path: ./fluvio/libs/ | |
- name: Prepare release tag | |
run: | | |
sed -E -i "s/^version '[A-Z0-9\\.\\-]+'$/version '${{ github.event.inputs.release-version }}'/" ./fluvio/build.gradle | |
git commit -am "Release ${{ github.event.inputs.release-version }} version" | |
git tag v${{ github.event.inputs.release-version }} | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v3 | |
- name: Publish package | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: publish -Prelease | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
- name: Prepare next snapshot version | |
run: | | |
sed -E -i "s/^version '[A-Z0-9\\.\\-]+'$/version '${{ github.event.inputs.next-snapshot-version }}'/" ./fluvio/build.gradle | |
git commit -am "Set next version to ${{ github.event.inputs.next-snapshot-version }}" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |