Merge pull request #203 from Backblaze/nbehrens/6.3.0-release #11
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
# Copyright 2022, Backblaze Inc. All Rights Reserved. | |
# License https://www.backblaze.com/using_b2_code.html | |
name: b2-sdk-java Maven Central deployment | |
on: | |
push: | |
tags: ['v*'] | |
jobs: | |
deploy: | |
name: Deploy | |
if: github.repository == 'Backblaze/b2-sdk-java' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Use jdk8 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '8' | |
cache: 'gradle' | |
- uses: gradle/wrapper-validation-action@v1 | |
- name: Deploy to Maven Central | |
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository createBundle --no-daemon --stacktrace | |
env: | |
RELEASE_BUILD: true | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | |
- name: Cleanup Gradle Cache | |
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | |
# Restoring these files from a GitHub Actions cache might cause problems for future builds. | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -fr ~/.gradle/caches/*/plugin-resolution/ | |
- name: Get tag name | |
id: get_tag | |
shell: bash | |
run: | | |
tag_name="$(echo $GITHUB_REF | cut -d / -f 3)" | |
echo ::set-output name=tag::$tag_name | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_tag.outputs.tag }} | |
name: ${{ steps.get_tag.outputs.tag }} | |
prerelease: false | |
draft: false | |
files: | | |
core/build/libs/bundle-*.jar | |
httpclient/build/libs/bundle-*.jar | |
samples/build/libs/bundle-*.jar |