-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (64 loc) · 2.32 KB
/
release.yaml
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
name: Manual release
on:
workflow_dispatch:
inputs:
versionModifier:
description: 'Version Modifier'
default: 'patch'
type: choice
required: true
options:
- 'patch'
- 'minor'
- 'major'
skipPublishing:
description: 'Skip artifact publishing'
required: false
type: boolean
default: 'false'
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'zulu'
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set defaults for Build Parameters
id: build_parameters
shell: bash
run: |
if [ "$SKIP_PUBLISH" = "true" ]; then
echo 'SKIPPING publish'
echo '::set-output name=publishCommand::'
else
echo 'not skipping publish'
echo '::set-output name=publishCommand::publishToSonatype closeAndReleaseSonatypeStagingRepository publishPlugins'
fi
env:
SKIP_PUBLISH: ${{ github.event.inputs.skipPublishing }}
- name: Build and Release Main
uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }} # only update the cache on the default branch https://github.com/gradle/gradle-build-action#optimizing-cache-effectiveness
arguments: |
-Psemver.modifier=${{ github.event.inputs.versionModifier }}
clean build ${{ steps.build_parameters.outputs.publishCommand }}
githubRelease
--stacktrace
env:
GITHUB_TOKEN: ${{ github.token }}
OSS_USER: '${{ secrets.OSS_USER }}'
OSS_TOKEN: '${{ secrets.OSS_TOKEN }}'
OSS_STAGING_PROFILE_ID: '${{ secrets.OSS_STAGING_PROFILE_ID }}'
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
- name: Stop Gradle daemons
run: ./gradlew --stop