@@ -24,45 +24,11 @@ jobs:
24
24
with :
25
25
fetch-depth : ' 0'
26
26
27
- - name : Set up JDK
28
- uses : actions/setup-java@v4
29
- with :
30
- java-version : ' 21'
31
- distribution : ' corretto'
32
- cache : ' maven'
33
-
34
- - name : Cache Maven packages
35
- uses : actions/cache@v4
36
- with :
37
- path : |
38
- ~/.m2/repository
39
- !~/.m2/repository/org/devgateway/tcdi
40
- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
41
- restore-keys : |
42
- ${{ runner.os }}-maven-
43
-
44
27
- name : Configure Git user
45
28
run : |
46
29
git config user.email "[email protected] "
47
30
git config user.name "Timothy Mugo Gachengo"
48
31
49
- - name : Build the Maven project
50
- run : |
51
- mvn package -DskipTests=true -Dcheckstyle.skip \
52
- && mkdir -p forms/target/deps \
53
- && cd forms/target/deps \
54
- && jar -xf ../*.jar
55
-
56
- - name : Generate a changelog
57
- uses : orhun/git-cliff-action@v3
58
- id : changelog
59
- with :
60
- config : cliff.toml
61
- env :
62
- OUTPUT : CHANGELOG.md
63
- GITHUB_REPO : ${{ github.repository }}
64
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65
-
66
32
- name : Generate Tag
67
33
id : tag_version
68
34
uses :
mathieudutour/[email protected]
73
39
dry_run : ' true'
74
40
75
41
build-and-push-docker-image :
76
- needs : release-and-tag
42
+ needs : prepare-a-release
77
43
runs-on : ubuntu-latest
44
+ outputs :
45
+ new_version : ${{ needs.prepare-a-release.outputs.new_version }}
46
+ new_tag : ${{ needs.prepare-a-release.outputs.new_tag }}
78
47
steps :
79
48
- name : Checkout Repository
80
49
uses : actions/checkout@v4
@@ -103,22 +72,61 @@ jobs:
103
72
context : .
104
73
push : true
105
74
build-args : |
106
- VERSION=${{ needs.release-and-tag .outputs.new_version }}
107
- TAG=${{ needs.release-and-tag .outputs.new_version }}
75
+ VERSION=${{ needs.prepare-a-release .outputs.new_version }}
76
+ TAG=${{ needs.prepare-a-release .outputs.new_tag }}
108
77
tags : |
109
78
${{ vars.DOCKER_REGISTRY }}/data-viz-admin:latest
110
- ${{ vars.DOCKER_REGISTRY }}/data-viz-admin:v${{ needs.release-and-tag .outputs.new_version }}
79
+ ${{ vars.DOCKER_REGISTRY }}/data-viz-admin:v${{ needs.prepare-a-release .outputs.new_version }}
111
80
112
81
release-on-github :
113
82
needs : build-and-push-docker-image
114
83
runs-on : ubuntu-latest
115
84
steps :
85
+ - name : Checkout Repository
86
+ uses : actions/checkout@v4
87
+ with :
88
+ fetch-depth : ' 0'
89
+
90
+ - name : Set up JDK
91
+ uses : actions/setup-java@v4
92
+ with :
93
+ java-version : ' 21'
94
+ distribution : ' corretto'
95
+ cache : ' maven'
96
+
97
+ - name : Cache Maven packages
98
+ uses : actions/cache@v4
99
+ with :
100
+ path : |
101
+ ~/.m2/repository
102
+ !~/.m2/repository/org/devgateway/tcdi
103
+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
104
+ restore-keys : |
105
+ ${{ runner.os }}-maven-
106
+
107
+ - name : Build the Maven project
108
+ run : |
109
+ mvn package -DskipTests=true -Dcheckstyle.skip \
110
+ && mkdir -p forms/target/deps \
111
+ && cd forms/target/deps \
112
+ && jar -xf ../*.jar
113
+
114
+ - name : Generate a changelog
115
+ uses : orhun/git-cliff-action@v3
116
+ id : changelog
117
+ with :
118
+ config : cliff.toml
119
+ env :
120
+ OUTPUT : CHANGELOG.md
121
+ GITHUB_REPO : ${{ github.repository }}
122
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
123
+
116
124
- name : Create Release
117
125
id : create_release
118
126
uses : softprops/action-gh-release@v2
119
127
with :
120
- tag_name : ${{ needs.release -and-tag .outputs.new_tag }}
121
- files : forms/target/deps/ *.jar
128
+ tag_name : ${{ needs.build -and-push-docker-image .outputs.new_tag }}
129
+ files : forms/target/*.jar
122
130
body_path : CHANGELOG.md
123
131
draft : false
124
132
prerelease : false
0 commit comments