1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-11 10:10:13 +01:00
Stirling-PDF/.github/workflows/swagger.yml

40 lines
1.2 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:
2024-04-21 17:30:17 +02:00
- uses: actions/checkout@v4
2024-04-21 17:30:17 +02:00
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
2024-02-11 17:47:00 +01:00
2024-04-21 17:30:17 +02:00
- uses: gradle/actions/setup-gradle@v3
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 }}