Skip to content

Commit

Permalink
Create release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cushon authored Sep 8, 2023
1 parent e50b5a0 commit d5c6224
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release turbine

on:
workflow_dispatch:
inputs:
version:
description: "version number for this release."
required: true

jobs:
build-maven-jars:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/[email protected]

- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 11
distribution: 'zulu'
cache: 'maven'
server-id: sonatype-nexus-staging
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Bump Version Number
run: |
mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}"
git ls-files | grep 'pom.xml$' | xargs git add
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git commit -m "Release turbine ${{ github.event.inputs.version }}"
git tag "v${{ github.event.inputs.version }}"
echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/google/turbine.git
- name: Deploy to Sonatype staging
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run:
mvn --no-transfer-progress -P sonatype-oss-release clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"

- name: Push tag
run: |
git push origin "v${{ github.event.inputs.version }}"
- name: Add Jars to Release Entry
uses: softprops/[email protected]
with:
draft: true
name: ${{ github.event.input.version }}
tag_name: "v${{ github.event.inputs.version }}"
target_commitish: ${{ env.TARGET_COMMITISH }}
files: |
core/target/turbine-*.jar

0 comments on commit d5c6224

Please sign in to comment.