-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
73 lines (72 loc) · 2.56 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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
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-"+${{ 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