Stirling-PDF/.github/workflows/swagger.yml

45 lines
1.5 KiB
YAML
Raw Normal View History

name: Update Swagger
on:
workflow_dispatch:
push:
2024-02-11 17:47:00 +01:00
branches:
- master
2024-03-22 21:15:42 +01:00
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2024-04-21 17:30:17 +02:00
- name: Set up JDK 17
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
2024-04-21 17:30:17 +02:00
with:
java-version: "17"
distribution: "temurin"
2024-02-11 17:47:00 +01:00
- uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
2024-02-11 17:47:00 +01:00
2024-04-21 17:30:17 +02:00
- name: Generate Swagger documentation
run: ./gradlew generateOpenApiDocs
2024-04-21 17:30:17 +02:00
- name: Upload Swagger Documentation to SwaggerHub
run: ./gradlew swaggerhubUpload
env:
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
2024-04-21 17:30:17 +02:00
- name: Get version number
id: versionNumber
run: echo "versionNumber=$(./gradlew printVersion --quiet | tail -1)" >> $GITHUB_OUTPUT
2023-06-04 00:32:47 +02:00
2024-04-21 17:30:17 +02:00
- name: Set API version as published and default on SwaggerHub
run: |
curl -X PUT -H "Authorization: ${SWAGGERHUB_API_KEY}" "https://api.swaggerhub.com/apis/Frooodle/Stirling-PDF/${{ steps.versionNumber.outputs.versionNumber }}/settings/lifecycle" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"published\":true,\"default\":true}"
env:
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}