10
10
11
11
12
12
jobs :
13
- release :
13
+ generate :
14
14
runs-on : ubuntu-latest
15
15
steps :
16
16
- name : Checkout Java
17
17
uses : actions/checkout@v3
18
+ - name : Setup Java
19
+ uses : actions/setup-java@v2
20
+ with :
21
+ distribution : ' temurin'
22
+ java-version : 8.0.x
18
23
- name : Checkout Gen
19
24
uses : actions/checkout@v3
20
25
with :
@@ -25,26 +30,45 @@ jobs:
25
30
run : |
26
31
SUFFIX=$(openssl rand -hex 4)
27
32
echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV
28
- - name : Generate
33
+ - name : Get Project Version
34
+ run : |
35
+ echo "PROJECT_VERSION=$(mvn -q \
36
+ -Dexec.executable="echo" \
37
+ -Dexec.args='${project.version}' \
38
+ --non-recursive \
39
+ org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)" >> $GITHUB_ENV
40
+ - name : Generate Openapi
29
41
run : |
30
- cd gen/openapi
42
+ pushd gen/openapi
31
43
cat <<"EOF"> settings
32
44
# Kubernetes branch to get the OpenAPI spec from.
33
45
export KUBERNETES_BRANCH="${{ github.event.inputs.kubernetesBranch }}"
34
46
35
47
# client version for packaging and releasing. It can
36
48
# be different than SPEC_VERSION.
37
- export CLIENT_VERSION=$(mvn -q \
38
- -Dexec.executable="echo" \
39
- -Dexec.args='${project.version}' \
40
- --non-recursive \
41
- org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)
49
+ export CLIENT_VERSION=${{ env.PROJECT_VERSION }}
42
50
51
+ # Name of the release package
43
52
export PACKAGE_NAME="io.kubernetes.client.openapi"
44
53
EOF
45
54
46
55
bash java.sh ../../kubernetes/ settings
47
- cd ../../
56
+ popd
57
+ rm -rf gen
58
+ - name : Generate Fluent
59
+ run : |
60
+ # Only install the generated openapi module because the higher modules' compile
61
+ # may fail due to api-changes.
62
+ mvn -Pfluent-gen -pl kubernetes -am clean install
63
+ pushd fluent-gen
64
+ bash -x generate.sh
65
+ popd
66
+ - name : Formatter
67
+ run : |
68
+ mvn spotless:apply
69
+ - name : Commit and push
70
+ run : |
71
+ # Commit and push
48
72
git config user.email "[email protected] "
49
73
git config user.name "Kubernetes Prow Robot"
50
74
git checkout -b "$BRANCH"
0 commit comments