-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (83 loc) · 2.68 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
name: Release
on:
workflow_dispatch:
inputs:
gradleLogLevel:
description: 'Gradle logging level.'
required: false
default: None
type: choice
options:
- None
- Info
- Warn
- Debug
- Stacktrace
jobs:
release:
runs-on: ubuntu-20.04
env:
GITHUB_USERNAME: Robothy
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java 17 for Gradle
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Gradle Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
key: ${{runner.os}}-build-gradle-${{hashFiles('**/gradle-wrapper.properties')}}
- name: Docker Layer Cache
uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
with:
key: ${{ runner.os }}-docker-layer-cache
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: luofuxiang
password: ${{secrets.DOCKER_HUB_TOKEN}}
- name: Docker Version
run: |
docker --version
- name: Prepare parameters
run: |
git log --pretty=format:"%H - %an, %aI : %s" -5
mkdir -p ~/.gradle
echo "GITHUB_TOKEN=${{secrets.PACKAGES_TOKEN}}" > ~/.gradle/gradle.properties
echo "GITHUB_USERNAME=Robothy" >> ~/.gradle/gradle.properties
echo "signing.secretKey=${{ secrets.SING_SECRET_KEY }}" >> ~/.gradle/gradle.properties
echo "signing.password=${{ secrets.SING_PASSWORD }}" >> ~/.gradle/gradle.properties
echo "OSSRH_USERNAME=${{ secrets.OSSRH_USERNAME }}" >> ~/.gradle/gradle.properties
echo "OSSRH_PASSWORD=${{ secrets.OSSRH_PASSWORD }}" >> ~/.gradle/gradle.properties
chmod +x gradlew
pwd
ls -l
- name: Update release version
run: |
./gradlew releaseVersion
- name: Release
if: ${{inputs.gradleLogLevel == 'None'}}
run: |
./gradlew check release
- name: Release(Info)
if: ${{inputs.gradleLogLevel == 'Info'}}
run: .|
./gradlew check release --info
- name: Release(Warn)
if: ${{inputs.gradleLogLevel == 'Warn'}}
run: .|
./gradlew check release --warn
- name: Release(Debug)
if: ${{inputs.gradleLogLevel == 'Debug'}}
run: |
./gradlew check release --debug
- name: Release(Stacktrace)
if: ${{inputs.gradleLogLevel == 'Stacktrace'}}
run: |
./gradlew check release --stacktrace