release 4.11.2 #20
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_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build Workflow Dispatch | |
uses: convictional/[email protected] | |
with: | |
owner: web3j | |
repo: web3j-evm | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
workflow_file_name: build.yml | |
wait_interval: 10 | |
propagate_failure: true | |
trigger_workflow: true | |
wait_workflow: true | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- 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: Decrypt secret key | |
run: openssl aes-256-cbc -K ${{ secrets.GPG_KEY }} -iv ${{ secrets.GPG_IV }} -in web3j.asc.enc -out web3j.asc -d | |
- 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-evm-"+${{ 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 |