-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (105 loc) · 6.46 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Generate Java Fabric8 Model From CRD
on:
workflow_dispatch:
inputs:
fabric8Version:
type: string
default: "6.5.1"
required: true
description: 'Fabric8 version'
robotOperatorTag:
type: string
required: true
description: 'Robot Operator tag. (existing)'
fleetOperatorTag:
type: string
required: true
description: 'Fleet Operator tag. (existing)'
connectionHubOperatorTag:
type: string
required: true
description: 'Connection Hub Operator tag. (existing)'
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/
rm -rf crds/base/*.yaml
# robot.roboscale.io/v1alpha2
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/robot-operator/${{ github.event.inputs.robotOperatorTag }}/config/crd/bases/robot.roboscale.io_ros2workloads.yaml
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/robot-operator/${{ github.event.inputs.robotOperatorTag }}/config/crd/bases/robot.roboscale.io_ros2bridges.yaml
# connection-hub.roboscale.io/v1alpha1
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/connection-hub-operator/${{ github.event.inputs.connectionHubOperatorTag }}/config/crd/bases/connection-hub.roboscale.io_connectionhubs.yaml
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/connection-hub-operator/${{ github.event.inputs.connectionHubOperatorTag }}/config/crd/bases/connection-hub.roboscale.io_cloudinstances.yaml
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/connection-hub-operator/${{ github.event.inputs.connectionHubOperatorTag }}/config/crd/bases/connection-hub.roboscale.io_physicalinstances.yaml
# fleet.roboscale.io/v1alpha1
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/fleet-operator/${{ github.event.inputs.fleetOperatorTag }}/config/crd/bases/fleet.roboscale.io_fleets.yaml
# dev.roboscale.io/v1alpha1
# wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/devspace-operator/${{ github.event.inputs.devspaceOperatorTag }}/config/crd/bases/dev.roboscale.io_devspaces.yaml
# wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/devspace-operator/${{ github.event.inputs.devspaceOperatorTag }}/config/crd/bases/dev.roboscale.io_workspacemanagers.yaml
# robot.roboscale.io/v1alpha1
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/robot-operator/${{ github.event.inputs.robotOperatorTag }}/config/crd/bases/robot.roboscale.io_robots.yaml
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/robot-operator/${{ github.event.inputs.robotOperatorTag }}/config/crd/bases/robot.roboscale.io_workspacemanagers.yaml
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/robot-operator/${{ github.event.inputs.robotOperatorTag }}/config/crd/bases/robot.roboscale.io_buildmanagers.yaml
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/robot-operator/${{ github.event.inputs.robotOperatorTag }}/config/crd/bases/robot.roboscale.io_launchmanagers.yaml
wget -P ./crds/base/ https://raw.githubusercontent.com/robolaunch/robot-operator/${{ github.event.inputs.robotOperatorTag }}/config/crd/bases/robot.roboscale.io_metricsexporters.yaml
- 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 Base CRDs
run: |
sudo /usr/local/bin/java-gen -s crds/base --target src/main/java
- name: Generate Models for Federated CRDs
run: |
sudo /usr/local/bin/java-gen -s crds/federated --target src/main/java
# - 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 ${{ github.event.inputs.clientTag }} for robot.roboscale.io ${{ github.event.inputs.robotOperatorTag }}, fleet.roboscale.io ${{ github.event.inputs.fleetOperatorTag }} and connection-hub.roboscale.io ${{ github.event.inputs.connectionHubOperatorTag }}"
tagging_message: ${{ github.event.inputs.clientTag }}
- uses: ncipollo/release-action@v1
with:
artifacts: target/robot-fabric8-client*.jar"
tag: ${{ github.event.inputs.clientTag }}
name: ${{ github.event.inputs.clientTag }}
prerelease: "${{ github.event.inputs.isPrerelease }}"
body: |
This release (${{ github.event.inputs.clientTag }}) supports the operator versions below:
| Components | Release Version |
|:-------------------------------------------------------------------------:|:---------------:|
| [robolaunch Robot Operator](https://github.com/robolaunch/robot-operator) | ${{ github.event.inputs.robotOperatorTag }} |
| [robolaunch Fleet Operator](https://github.com/robolaunch/fleet-operator) | ${{ github.event.inputs.fleetOperatorTag }} |
| [robolaunch Connection Hub Operator](https://github.com/robolaunch/connection-hub-operator) | ${{ github.event.inputs.connectionHubOperatorTag }} |
- uses: actions/upload-artifact@v3
with:
name: generated-java-crd-model
path: |
${{ env.GEN_DIR }}