-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (90 loc) · 3.73 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Release
on:
workflow_dispatch:
inputs:
version:
description: Bump Version
default: 1.0.0
required: true
tweet:
description: extra text for tweet
required: false
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- uses: gradle/gradle-build-action@v2
name: Build with Gradle
with:
arguments: build
- name: Identify current version
id: current_version
uses: christian-draeger/[email protected]
with:
path: './gradle.properties'
property: 'version'
- name: Write new version
uses: christian-draeger/[email protected]
with:
path: './gradle.properties'
property: 'version'
value: ${{ github.event.inputs.version }}
- name: Find and Replace version reference in all readme files of the repo
uses: jacobtomlinson/gha-find-replace@v2
with:
find: ${{ steps.current_version.outputs.value }}
replace: ${{ github.event.inputs.version }}
include: "README.md" # Will match all README.md files in any nested directory
# deactivate for now since commit action is not able to push changes in workflow files because of missing permission
# - name: Update github action release workflow default version
# uses: fjogeleit/[email protected]
# with:
# valueFile: '.github/workflows/release.yml'
# propertyPath: 'on.workflow_dispatch.inputs.version.default'
# commitChange: 'false'
# updateFile: 'true'
# value: ${{ github.event.inputs.version }}
- uses: gradle/gradle-build-action@v2
name: Publish to Maven Central
env:
ORG_GRADLE_PROJECT_signingKey: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_signingKeyId: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID}}
ORG_GRADLE_PROJECT_signingPassword: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME}}
ORG_GRADLE_PROJECT_sonatypePassword: ${{secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD}}
with:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
# - name: Deploy docs
# uses: mhausenblas/mkdocs-deploy-gh-pages@master
# # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# #CUSTOM_DOMAIN: optionaldomain.com
# CONFIG_FILE: mkdocs.yml
# #EXTRA_PACKAGES: build-base
# # GITHUB_DOMAIN: github.myenterprise.com
# #REQUIREMENTS: folder/requirements.txt
- uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
commit_user_name: manosbatsis
commit_user_email: [email protected]
commit_author: manosbatsis <[email protected]>
commit_message: bump version ${{ steps.current_version.outputs.value }} --> ${{ github.event.inputs.version }}
- name: Create Tag
uses: negz/create-tag@v1
with:
version: ${{ github.event.inputs.version }}
message: ${{ github.event.inputs.version.description }}
token: ${{ secrets.GITHUB_TOKEN }}