Skip to content

release 0.4.0

release 0.4.0 #6

Workflow file for this run

name: Release
on:
push:
branches: [ 'release/**' ]
workflow_dispatch:
jobs:
integration-test:
runs-on: ubuntu-latest
env:
registry.username: ${{ secrets.REGISTRY_USERNAME }}
registry.password: ${{ secrets.REGISTRY_PASSWORD }}
steps:
- uses: actions/checkout@v2
- 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
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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: Build
run: ./gradlew build
if: ${{ success() }}
release:
runs-on: ubuntu-latest
needs: [ build ]
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: web3j
repo: web3j-sokt
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: 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 }}.*