From 07950ee515bf5aef23ed15625021888200d6ed58 Mon Sep 17 00:00:00 2001 From: Daniel Meier Date: Fri, 31 May 2024 17:45:32 +0200 Subject: [PATCH] Upload OpenAPI Specification as Release Asset --- .github/workflows/publish.yml | 13 +++++++++++++ app/build.gradle.kts | 2 ++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b9c7c33..01cd8d9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -54,6 +54,19 @@ jobs: asset_name: tsa-linux-amd64 asset_content_type: application/octet-stream + - name: Copy OpenAPI Spec to Temporary Folder + run: cp app/build/openapi-specification.json $RUNNER_TEMP/openapi-specification.json + + - name: Upload OpenAPI Spec as Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ runner.temp }}/openapi-specification.json + asset_name: openapi-specification.json + asset_content_type: application/json + - name: Build and Push JVM Images env: QUARKUS_CONTAINER_IMAGE_BUILD: true diff --git a/app/build.gradle.kts b/app/build.gradle.kts index cb00094..a6bbf4d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -61,9 +61,11 @@ tasks.withType().configureEach { options.compilerArgs.add("-parameters") } +// this file is used in the publish-workflow as well val openApiSpecificationFile = layout.buildDirectory.file("openapi-specification.json") tasks.test { + inputs.property("project-version", provider { project.version }) outputs.file(openApiSpecificationFile) systemProperty("openapi.specification.target-file", openApiSpecificationFile.get().asFile.absolutePath) }