spotless and git-publish plugin version downgrade #71
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: Release | |
on: | |
push: | |
branches: [ 'release/**' ] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_WEB3J_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | |
OSSRH_GPG_SECRET_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build Workflow Dispatch | |
uses: convictional/[email protected] | |
with: | |
owner: hyperledger | |
repo: web3j | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
workflow_file_name: build.yml | |
wait_interval: 10 | |
propagate_failure: true | |
trigger_workflow: true | |
wait_workflow: true | |
continue-on-error: true | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Release name | |
id: release_name | |
uses: actions/github-script@v4 | |
with: | |
result-encoding: string | |
script: | | |
const branch_name = process.env.GITHUB_REF | |
const web3j_release_version = branch_name.substring(branch_name.lastIndexOf('/') +1 ,branch_name.length ) | |
process.env.VERSION = web3j_release_version | |
return web3j_release_version | |
- name: Build and stage release | |
run: ./gradlew publish -Pversion=${{ steps.release_name.outputs.result }} | |
- name: Release | |
run: ./gradlew closeAndReleaseRepository | |
outputs: | |
stripped_version: ${{ steps.release_name.outputs.result }} | |
git-release: | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Github Release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: 'v${{ needs.release.outputs.stripped_version }}' | |
prerelease: false | |
files: | | |
"web3j-"+${{ steps.release_name.outputs.result }}.* | |
javadocs-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Javadoc release | |
run: ./gradlew -Dorg.ajoberstar.grgit.auth.username=${{ secrets.GITHUB_TOKEN }} core:gitPublishPush |