1+ name : Release Integrations without JEC scripts
2+ on :
3+ workflow_dispatch :
4+ inputs :
5+ integration :
6+ description : ' Integration Type'
7+ required : true
8+ type : choice
9+ options :
10+ - opsview
11+ - vcenter
12+ - vcsa
13+ - oem
14+ jobs :
15+ setup :
16+ name : Setup For ${{ github.event.inputs.integration }} Release
17+ runs-on : ubuntu-latest
18+ outputs :
19+ upload_url : ${{ steps.create_release.outputs.upload_url }}
20+ integration_name : ${{ steps.gather_params.outputs.INTEGRATION_NAME }}
21+ integration_version : ${{ steps.gather_params.outputs.INTEGRATION_VERSION }}
22+ steps :
23+ - name : Check out code into the Go module directory
24+ uses : actions/checkout@v2
25+ - name : Retrieve Integration Version
26+ id : gather_params
27+ run : |
28+ echo ::set-output name=INTEGRATION_VERSION::$(jq -r --arg v "${{ github.event.inputs.integration }}" '.[$v]' release/integration-builder/version.json)
29+ echo ::set-output name=INTEGRATION_NAME::$(echo "${{ github.event.inputs.integration }}" | awk '{print tolower($0)}')
30+ - name : Create ${{ github.event.inputs.integration }} Release
31+ id : create_release
32+ uses : actions/create-release@v1
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+ INTEGRATION_VERSION : ${{ steps.gather_params.outputs.INTEGRATION_VERSION }}
36+ INTEGRATION_NAME : ${{ github.event.inputs.integration }}
37+ with :
38+ tag_name : jsm-${{ env.INTEGRATION_NAME }}-${{ env.INTEGRATION_VERSION }}
39+ release_name : jsm-${{ env.INTEGRATION_NAME }}-${{ env.INTEGRATION_VERSION }}
40+ draft : true
41+ build-gradle-project :
42+ name : Build gradle project
43+ runs-on : ubuntu-latest
44+ needs : [setup]
45+ env :
46+ INTEGRATION_NAME : ${{ needs.setup.outputs.integration_name }}
47+ INTEGRATION_VERSION : ${{ needs.setup.outputs.integration_version }}
48+ if : github.ref == 'refs/heads/master'
49+ steps :
50+ - name : Checkout project sources
51+ uses : actions/checkout@v2
52+ - name : Set up JDK 8
53+ uses : actions/setup-java@v2
54+ with :
55+ java-version : 8
56+ distribution : ' temurin'
57+ - name : Set up Go 1.x
58+ uses : actions/setup-go@v2
59+ with :
60+ go-version : 1.15.7
61+ id : go
62+ - name : Create Go Build Output Directory
63+ run : mkdir -p ./go-build/${{ env.INTEGRATION_NAME }}
64+ - name : Copy Integration Files
65+ run : cp -R ${{ github.event.inputs.integration }}/. ./go-build/${{ env.INTEGRATION_NAME }}
66+ - name : " Build Linux Go scripts"
67+ if : ${{env.INTEGRATION_NAME != 'vcenter'}}
68+ run : |
69+ go get -u github.com/alexcesaro/log && \
70+ cd ./go-build/${{ env.INTEGRATION_NAME }}/scripts && \
71+ GOOS=linux GOARCH=amd64 go build -o send2jsm send2jsm.go
72+ - name : " Build Windows Go scripts"
73+ if : ${{env.INTEGRATION_NAME == 'vcenter'}}
74+ run : |
75+ go get -u github.com/alexcesaro/log && \
76+ cd ./go-build/${{ env.INTEGRATION_NAME }}/scripts && \
77+ GOOS=windows GOARCH=386 go build -o send2jsm.exe send2jsm.go
78+ - name : Upload Go Build Files
79+ uses : actions/upload-artifact@v2
80+ with :
81+ name : Build Go Artifact
82+ path : ./go-build/${{ env.INTEGRATION_NAME }}/*
83+ - name : Copy Gradle Files
84+ run : cp -R release/integration-builder/. ./
85+ - name : Copy Integration Files with Builds
86+ run : cp -R ./go-build/${{ env.INTEGRATION_NAME }}/* ./${{ env.INTEGRATION_NAME }}/
87+ - name : Remove old builds
88+ run : rm -rf build
89+ - name : Build with Gradle
90+ run :
91+ ./gradlew ${{ env.INTEGRATION_NAME }}
92+ - name : Upload Build Files
93+ uses : actions/upload-artifact@v2
94+ with :
95+ name : Build Files Artifact
96+ path : build/*
97+ - name : Upload Red Hat 6 Based Artifact
98+ if : ${{env.INTEGRATION_NAME != 'vcenter'}}
99+ uses : actions/upload-artifact@v2
100+ with :
101+ name : RHEL6 Artifact
102+ path : build/distributions/jsm-${{ env.INTEGRATION_NAME }}-${{ env.INTEGRATION_VERSION }}-1.all.noarch.rpm
103+ - name : Release RHEL6 package
104+ if : ${{env.INTEGRATION_NAME != 'vcenter'}}
105+ uses : actions/upload-release-asset@v1
106+ env :
107+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
108+ with :
109+ upload_url : ${{ needs.setup.outputs.upload_url }}
110+ asset_path : build/distributions/jsm-${{ env.INTEGRATION_NAME }}-${{ env.INTEGRATION_VERSION }}-1.all.noarch.rpm
111+ asset_name : jsm-${{ env.INTEGRATION_NAME }}-${{ env.INTEGRATION_VERSION }}-1.all.noarch.rpm
112+ asset_content_type : application/octet-stream
113+ - name : Upload Debian Based Artifact
114+ if : ${{env.INTEGRATION_NAME != 'vcsa' && env.INTEGRATION_NAME != 'vcenter'}}
115+ uses : actions/upload-artifact@v2
116+ with :
117+ name : Debian Artifact
118+ path : build/distributions/jsm-${{ env.INTEGRATION_NAME }}_${{ env.INTEGRATION_VERSION }}_all.deb
119+ - name : Release Debian package
120+ if : ${{env.INTEGRATION_NAME != 'vcsa' && env.INTEGRATION_NAME != 'vcenter'}}
121+ uses : actions/upload-release-asset@v1
122+ env :
123+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
124+ with :
125+ upload_url : ${{ needs.setup.outputs.upload_url }}
126+ asset_path : build/distributions/jsm-${{ env.INTEGRATION_NAME }}_${{ env.INTEGRATION_VERSION }}_all.deb
127+ asset_name : jsm-${{ env.INTEGRATION_NAME }}_${{ env.INTEGRATION_VERSION }}_all.deb
128+ asset_content_type : application/octet-stream
129+ - name : Upload Win64 Based Artifact
130+ if : ${{env.INTEGRATION_NAME == 'vcenter'}}
131+ uses : actions/upload-artifact@v2
132+ with :
133+ name : Win64 Artifact
134+ path : build/distributions/jsm-${{ env.INTEGRATION_NAME }}-${{ env.INTEGRATION_VERSION }}.zip
135+ - name : Release Win64 Package
136+ if : ${{env.INTEGRATION_NAME == 'vcenter'}}
137+ uses : actions/upload-release-asset@v1
138+ env :
139+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
140+ with :
141+ upload_url : ${{ needs.setup.outputs.upload_url }}
142+ asset_path : build/distributions/jsm-${{ env.INTEGRATION_NAME }}-${{ env.INTEGRATION_VERSION }}.zip
143+ asset_name : jsm-${{ env.INTEGRATION_NAME }}-${{ env.INTEGRATION_VERSION }}.zip
144+ asset_content_type : application/zip
0 commit comments