forked from robolaunch/robot-client-java-fabric8
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (63 loc) · 2.37 KB
/
generate-client.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
name: Generate Java Fabric8 Model From CRD
on:
workflow_dispatch:
inputs:
fabric8Version:
type: string
default: "6.5.1"
required: true
description: 'Fabric8 version'
clientTag:
type: string
required: true
description: 'Kubernetes Java Fabric8 Client tag. (will be generated)'
isPrerelease:
type: boolean
default: true
required: true
description: 'Is this a prerelease of Kubernetes Java client?'
env:
GEN_DIR: .
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Release name
run: |
sudo apt-get update && sudo apt-get install xmlstarlet -y
xmlstarlet edit -L -N p=http://maven.apache.org/POM/4.0.0 --update '/p:project/p:version' --value ${{ github.event.inputs.clientTag }} pom.xml
- name: Fetch CRDs
run: |
rm -rf src/
- name: Configure Code Generator
run: |
wget https://oss.sonatype.org/content/repositories/releases/io/fabric8/java-generator-cli/${{ github.event.inputs.fabric8Version }}/java-generator-cli-${{ github.event.inputs.fabric8Version }}.sh
mv java-generator-cli-${{ github.event.inputs.fabric8Version }}.sh java-gen
chmod +x java-gen
mv java-gen /usr/local/bin/
- name: Generate Models for External CRDs
run: |
sudo /usr/local/bin/java-gen -s crds/external --target src/main/java
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "build(ci): generate fabric8 models for version ${{ github.event.inputs.clientTag }}"
tagging_message: ${{ github.event.inputs.clientTag }}
- uses: ncipollo/release-action@v1
with:
artifacts: target/external-fabric8-models*.jar"
tag: ${{ github.event.inputs.clientTag }}
name: ${{ github.event.inputs.clientTag }}
prerelease: "${{ github.event.inputs.isPrerelease }}"
body: |
This release (${{ github.event.inputs.clientTag }}) supports [these CRDs](https://github.com/robolaunch/external-fabric8-models/tree/${{ github.event.inputs.clientTag }}/crds/external).
- uses: actions/upload-artifact@v3
with:
name: generated-java-crd-model
path: |
${{ env.GEN_DIR }}