4
4
name : Automated Release
5
5
on :
6
6
schedule :
7
- - cron : 45 3 * * TUE
7
+ - cron : 35 5 * * MON
8
8
workflow_dispatch :
9
9
jobs :
10
10
publish :
@@ -14,10 +14,17 @@ jobs:
14
14
steps :
15
15
- id : checkout
16
16
name : Clone Git Repository
17
- uses : actions/checkout@v3
17
+ uses : actions/checkout@v4
18
+ with :
19
+ fetch-depth : 0
20
+ - id : last_release
21
+ name : Fetch last release info
22
+ run : echo "tag=$(gh release view --json tagName --jq '.tagName')" >> $GITHUB_OUTPUT
23
+ env :
24
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
18
25
- id : commits
19
26
name : Count Commits
20
- run : echo "count=$(git rev-list --count HEAD --since='last Tuesday' )" >> $GITHUB_OUTPUT
27
+ run : echo "count=$(git rev-list --count ${{ steps.last_release.outputs.tag }}.. HEAD -- pom.xml memoization-core/pom.xml memoization-core/src/main/java memoization-jdk/pom.xml memoization-jdk/src/main/java memoization-jool/pom.xml memoization-jool/src/main/java memoization-lambda/pom.xml memoization-lambda/src/main/java memoization-rxjava/pom.xml memoization-rxjava/src/main/java )" >> $GITHUB_OUTPUT
21
28
- id : release
22
29
name : Create Release Version
23
30
if : steps.commits.outputs.count > 0
@@ -30,24 +37,16 @@ jobs:
30
37
name : Build Timestamp
31
38
if : steps.commits.outputs.count > 0
32
39
run : echo "iso8601=$(date --utc --iso-8601=seconds)" >> $GITHUB_OUTPUT
33
- - uses : ./.github/actions/managed-maven
40
+ - id : setup-java
41
+ uses : ./.github/actions/managed-maven
34
42
if : steps.commits.outputs.count > 0
35
- - id : cache
36
- name : Cache Dependencies
37
- if : steps.commits.outputs.count > 0
38
- uses : actions/cache@v3
39
- with :
40
- path : ~/.m2/repository
41
- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
42
- restore-keys : |
43
- ${{ runner.os }}-maven-
44
43
- id : gpg
45
44
name : GPG Key
46
45
if : steps.commits.outputs.count > 0
47
- uses : timheuer/base64-to-file@v1.2
46
+ uses : timheuer/base64-to-file@v1
48
47
with :
49
48
fileName : signing.key.asc
50
- fileDir : ${{ github.workspace}}
49
+ fileDir : ${{ github.workspace }}
51
50
encodedString : ${{ secrets.GPG_SECRET_KEY_BASE64 }}
52
51
- id : pom-version
53
52
name : Set Release Version
@@ -56,15 +55,15 @@ jobs:
56
55
- id : deploy-maven
57
56
name : Deploy Maven Artifact
58
57
if : steps.commits.outputs.count > 0
59
- run : |
60
- mvn \
61
- --batch-mode \
62
- --activate-profiles release \
63
- --define scmTag=${{ steps.sha.outputs.sha }} \
64
- --define pgp.secretkey=keyfile:${{ steps.gpg.outputs.filePath }} \
65
- --define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }} \
66
- --define project.build.outputTimestamp=${{ steps.timestamp.outputs.iso8601 }} \
67
- deploy
58
+ run : >
59
+ mvn
60
+ --batch-mode
61
+ --activate-profiles release
62
+ --define scmTag=${{ steps.sha.outputs.sha }}
63
+ --define pgp.secretkey=keyfile:${{ steps.gpg.outputs.filePath }}
64
+ --define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }}
65
+ --define project.build.outputTimestamp=${{ steps.timestamp.outputs.iso8601 }}
66
+ deploy
68
67
env :
69
68
MAVEN_CENTRAL_USERNAME : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
70
69
MAVEN_CENTRAL_TOKEN : ${{ secrets.MAVEN_CENTRAL_TOKEN }}
83
82
- id : mail
84
83
name : Send Mail
85
84
if : steps.commits.outputs.count > 0
86
- uses : dawidd6/action-send-mail@v3.7.1
85
+ uses : dawidd6/action-send-mail@v3
87
86
with :
88
87
server_address : ${{ secrets.MAIL_SERVER }}
89
88
server_port : ${{ secrets.MAIL_PORT }}
0 commit comments