1name: Release turbine 2 3on: 4 workflow_dispatch: 5 inputs: 6 version: 7 description: "version number for this release." 8 required: true 9 10jobs: 11 build-maven-jars: 12 runs-on: ubuntu-latest 13 permissions: 14 contents: write 15 steps: 16 - name: Checkout 17 uses: actions/checkout@v2.4.0 18 19 - name: Set up JDK 20 uses: actions/setup-java@v2.5.0 21 with: 22 java-version: 17 23 distribution: 'zulu' 24 cache: 'maven' 25 server-id: sonatype-nexus-staging 26 server-username: CI_DEPLOY_USERNAME 27 server-password: CI_DEPLOY_PASSWORD 28 gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} 29 gpg-passphrase: MAVEN_GPG_PASSPHRASE 30 31 - name: Bump Version Number 32 run: | 33 mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}" 34 git ls-files | grep 'pom.xml$' | xargs git add 35 git config --global user.email "${{ github.actor }}@users.noreply.github.com" 36 git config --global user.name "${{ github.actor }}" 37 git commit -m "Release turbine ${{ github.event.inputs.version }}" 38 git tag "v${{ github.event.inputs.version }}" 39 echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV 40 git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/google/turbine.git 41 42 - name: Deploy to Sonatype staging 43 env: 44 CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} 45 CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} 46 GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 47 run: 48 mvn --no-transfer-progress -P sonatype-oss-release clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" 49 50 - name: Push tag 51 run: | 52 git push origin "v${{ github.event.inputs.version }}" 53 54 - name: Add Jars to Release Entry 55 uses: softprops/action-gh-release@v0.1.14 56 with: 57 draft: true 58 name: ${{ github.event.input.version }} 59 tag_name: "v${{ github.event.inputs.version }}" 60 target_commitish: ${{ env.TARGET_COMMITISH }} 61 files: | 62 target/turbine-*.jar 63