diff --git a/.github/workflows/extract-all-openapi.yml b/.github/workflows/extract-all-openapi.yml new file mode 100644 index 0000000..d2d346e --- /dev/null +++ b/.github/workflows/extract-all-openapi.yml @@ -0,0 +1,106 @@ +# Extracts the OpenAPI specs from multiple Checkmk versions and stores them as an artifact + +name: Extract all OpenAPI specs + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + extract-all-openapi: + uses: 1and1/checkmk-java-client/.github/workflows/extract-openapi.yaml@main + with: + cmk_version: ${{ matrix.version }} + target_artifact: openapi + file_name: checkmk_${{ matrix.version }}_openapi.yml + strategy: + matrix: + version: + - 2.0.0p1 + - 2.0.0p2 + - 2.0.0p3 + - 2.0.0p4 + - 2.0.0p5 + - 2.0.0p6 + - 2.0.0p7 + - 2.0.0p8 + - 2.0.0p9 + - 2.0.0p10 + - 2.0.0p11 + - 2.0.0p12 + - 2.0.0p13 + - 2.0.0p14 + - 2.0.0p15 + - 2.0.0p16 + - 2.0.0p17 + - 2.0.0p18 + - 2.0.0p19 + - 2.0.0p20 + - 2.0.0p21 + - 2.0.0p22 + - 2.0.0p23 + - 2.0.0p24 + - 2.0.0p25 + - 2.0.0p26 + - 2.0.0p27 + - 2.0.0p28 + - 2.0.0p29 + - 2.0.0p30 + - 2.0.0p31 + - 2.0.0p32 + - 2.0.0p33 + - 2.0.0p34 + - 2.0.0p35 + - 2.0.0p36 + - 2.0.0p37 + - 2.0.0p38 + - 2.0.0p39 + - 2.1.0p1 + - 2.1.0p2 + - 2.1.0p3 + - 2.1.0p4 + - 2.1.0p5 + - 2.1.0p6 + - 2.1.0p8 + - 2.1.0p9 + - 2.1.0p10 + - 2.1.0p11 + - 2.1.0p12 + - 2.1.0p13 + - 2.1.0p14 + - 2.1.0p15 + - 2.1.0p16 + - 2.1.0p17 + - 2.1.0p18 + - 2.1.0p19 + - 2.1.0p20 + - 2.1.0p21 + - 2.1.0p22 + - 2.1.0p23 + - 2.1.0p24 + - 2.1.0p25 + - 2.1.0p26 + - 2.1.0p27 + - 2.1.0p28 + - 2.1.0p29 + - 2.1.0p30 + - 2.1.0p31 + - 2.1.0p32 + - 2.1.0p33 + - 2.1.0p34 + - 2.1.0p35 + - 2.1.0p36 + - 2.2.0p1 + - 2.2.0p2 + - 2.2.0p3 + - 2.2.0p4 + - 2.2.0p5 + - 2.2.0p6 + - 2.2.0p7 + - 2.2.0p8 + - 2.2.0p9 + - 2.2.0p11 + - 2.2.0p12 + - 2.2.0p14 diff --git a/.github/workflows/extract-openapi.yaml b/.github/workflows/extract-openapi.yaml index 108c137..5767de2 100644 --- a/.github/workflows/extract-openapi.yaml +++ b/.github/workflows/extract-openapi.yaml @@ -9,7 +9,10 @@ on: target_artifact: required: true type: string - + file_name: + type: string + default: openapi-doc.yaml + jobs: extract-openapi: runs-on: ubuntu-latest @@ -22,12 +25,12 @@ jobs: run: while ! curl "http://localhost:8080//cmk/check_mk/"; do sleep 1; echo -n "."; done - name: Fetch the OpenAPI spec - run: curl -H 'Authorization:Bearer cmkadmin HELLO' "http://localhost:8080/cmk/check_mk/api/v0/openapi-doc.yaml" -o openapi-doc.yaml + run: curl -H 'Authorization:Bearer cmkadmin HELLO' "http://localhost:8080/cmk/check_mk/api/v0/openapi-doc.yaml" -o ${{ inputs.file_name }} - uses: actions/upload-artifact@v3 with: name: ${{ inputs.target_artifact }} - path: openapi-doc.yaml + path: ${{ inputs.file_name }} - name: Kill cmk run: docker kill cmk diff --git a/.github/workflows/maven-release.yaml b/.github/workflows/maven-release.yaml index a953d15..0f6c504 100644 --- a/.github/workflows/maven-release.yaml +++ b/.github/workflows/maven-release.yaml @@ -8,24 +8,8 @@ on: jobs: - extract-openapi: - uses: 1and1/checkmk-java-client/.github/workflows/extract-openapi.yaml@main - with: - cmk_version: 2.2.0p12 - target_artifact: openapi - - generate-code: - needs: extract-openapi - uses: 1and1/checkmk-java-client/.github/workflows/generate-code.yaml@main - with: - cmk_version: 2.2.0p12 - source_artifact: openapi - target_artifact: source - snapshot: false - build: runs-on: ubuntu-latest - needs: generate-code outputs: version: ${{ steps.version.outputs.version }} md5sum: ${{ steps.md5sum.outputs.md5sum }} @@ -42,18 +26,10 @@ jobs: distribution: 'adopt' java-version: 17 - - name: Download source - uses: actions/download-artifact@v3 - with: - name: source - - - name: Download openapi - uses: actions/download-artifact@v3 - with: - name: openapi - - name: Build with Maven run: mvn -B package --file pom.xml + env: + JAVA_POST_PROCESS_FILE: ./java_post_process_file.sh - name: Extract current maven version run: echo "::set-output name=version::$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)" diff --git a/pom.xml b/pom.xml index 6400765..2a7f5a9 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.4.1 enforce-maven @@ -127,7 +127,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.4.0 + 3.5.0 add_sources @@ -158,7 +158,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.2 + 3.6.3 attach-javadocs @@ -194,7 +194,7 @@ org.apache.maven.plugins maven-release-plugin - 3.0.0-M1 + 3.0.1 true release @@ -239,7 +239,7 @@ - 1.8 + 1.10.0 true @@ -260,7 +260,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts @@ -317,7 +317,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 0AC5A45E91FA93DA25380017B0D87B063EAD41F1 @@ -413,11 +413,11 @@ 1.8 ${java.version} ${java.version} - 1.8.5 + 1.9.0 1.6.3 4.12.0 2.10.1 - 3.13.0 + 3.14.0 0.2.6 1.3.5 3.0.3