diff --git a/.github/workflows/apidoc.yaml b/.github/workflows/apidoc.yaml deleted file mode 100644 index 4b620b88230..00000000000 --- a/.github/workflows/apidoc.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: Verify and Publish OpenAPI Specs - -on: - workflow_call: - inputs: - version: - required: true - description: "The version under which the API should be published" - type: string - - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - Publish-To-SwaggerHub: - # do NOT run on forks. The Org ("edc") is unique all across SwaggerHub - if: github.repository == 'eclipse-edc/Connector' - runs-on: ubuntu-latest - strategy: - matrix: - apiGroup: [ 'public-api', 'management-api', 'control-api' ] - env: - rootDir: resources/openapi/yaml/${{ matrix.apiGroup }} - SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_TOKEN }} - SWAGGERHUB_USER: ${{ secrets.SWAGGERHUB_USER }} - VERSION: ${{ github.event.inputs.version || inputs.version }} - steps: - - uses: actions/checkout@v4 - - uses: eclipse-edc/.github/.github/actions/setup-build@main - - uses: actions/setup-node@v4 - - # merge together all api groups - - name: Generate API Specs - run: | - # give option to override - cmd="" - if [ ! -z $VERSION ]; then - cmd="-Pversion=$VERSION" - fi - ./gradlew resolve - ./gradlew ${cmd} -PapiTitle="${{ matrix.apiGroup }}" -PapiDescription="REST API documentation for the ${{ matrix.apiGroup }}" :mergeApiSpec --input=${{ env.rootDir }} --output=${{ matrix.apiGroup }}.yaml - - # install swaggerhub CLI - - name: Install SwaggerHub CLI - run: npm i -g swaggerhub-cli - - # create API, will fail if exists - - name: Create API - continue-on-error: true - run: | - swaggerhub api:create ${{ env.SWAGGERHUB_USER }}/${{ matrix.apiGroup }} -f ${{ matrix.apiGroup }}.yaml --visibility=public --published=unpublish - - # Post snapshots of the API to SwaggerHub as "unpublished", because published APIs cannot be overwritten - - name: Publish API Specs to SwaggerHub - run: | - # coalesce $VERSION, or whatever's stored in gradle.properties - vers=${VERSION:-$(grep "version" gradle.properties | awk -F= '{print $2}')} - - if [[ $vers != *-SNAPSHOT ]]; then - echo "no snapshot, will set the API to 'published'"; - swaggerhub api:update ${{ env.SWAGGERHUB_USER }}/${{ matrix.apiGroup }} -f ${{ matrix.apiGroup }}.yaml --visibility=public --published=publish - swaggerhub api:setdefault ${{ env.SWAGGERHUB_USER }}/${{ matrix.apiGroup }}/$vers - else - echo "snapshot, will set the API to 'unpublished'"; - swaggerhub api:update ${{ env.SWAGGERHUB_USER }}/${{ matrix.apiGroup }} -f ${{ matrix.apiGroup }}.yaml --visibility=public --published=unpublish - fi diff --git a/.github/workflows/release-edc.yml b/.github/workflows/release-edc.yml index aebd13c36e4..bab424c4599 100644 --- a/.github/workflows/release-edc.yml +++ b/.github/workflows/release-edc.yml @@ -48,23 +48,6 @@ jobs: with: version: ${{ needs.Prepare-Release.outputs.edc-version }} - publish-openapi-ui: - needs: Prepare-Release - uses: eclipse-edc/.github/.github/workflows/publish-openapi-ui.yml@main - secrets: inherit - with: - version: ${{ needs.Prepare-Release.outputs.edc-version }} - - # DEPRECATED: Calls the openapi workflow to publish the api spec on SwaggerHub - Publish-OpenApi: - needs: - - Prepare-Release - if: ${{ !endsWith( needs.Prepare-Release.outputs.edc-version, '-SNAPSHOT') }} - uses: ./.github/workflows/apidoc.yaml - secrets: inherit - with: - version: ${{ needs.Prepare-Release.outputs.edc-version }} - Github-Release: # cannot use the workflow-level env yet as it does not yet exist, must take output from previous job if: ${{ !endsWith( needs.Prepare-Release.outputs.edc-version, '-SNAPSHOT') }}