chore(ci): publish an openapi json artifact with nightly releases (#999)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
name: Export OpenAPI
|
||||
description: Check out a ref, set up the backend toolchain, and export grimmory-openapi.json.
|
||||
|
||||
inputs:
|
||||
app_version:
|
||||
description: Application version string to embed into the exported OpenAPI document.
|
||||
required: true
|
||||
checkout_ref:
|
||||
description: Git ref or SHA to export from.
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
ref: ${{ inputs.checkout_ref }}
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@5f57d6cb7cd20b14a8a27f522884c4bc8a187458 # v2.75.19
|
||||
with:
|
||||
tool: just
|
||||
|
||||
- name: Set Up JDK 25
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||
with:
|
||||
java-version: '25'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Export OpenAPI JSON
|
||||
shell: bash
|
||||
env:
|
||||
APP_VERSION: ${{ inputs.app_version }}
|
||||
run: just api openapi-export
|
||||
@@ -133,6 +133,28 @@ jobs:
|
||||
type=gha,scope=image-shared,mode=max
|
||||
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache,mode=max
|
||||
|
||||
export-openapi:
|
||||
name: Export Nightly OpenAPI Artifact
|
||||
needs: [resolve_ref, test-suite, build-and-push]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Export OpenAPI JSON
|
||||
uses: ./.github/actions/export-openapi
|
||||
with:
|
||||
checkout_ref: ${{ needs.resolve_ref.outputs.commit_sha }}
|
||||
app_version: ${{ needs.resolve_ref.outputs.nightly_tag }}
|
||||
|
||||
- name: Upload Nightly OpenAPI Artifact
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: nightly-openapi-${{ needs.resolve_ref.outputs.nightly_tag }}
|
||||
path: backend/build/openapi/grimmory-openapi.json
|
||||
retention-days: 30
|
||||
|
||||
generate-notes:
|
||||
name: Nightly Changelog
|
||||
if: ${{ always() && needs.test-suite.result == 'success' }}
|
||||
@@ -165,8 +187,8 @@ jobs:
|
||||
|
||||
notify-discord:
|
||||
name: Notify Discord (Nightly)
|
||||
if: ${{ always() && needs.generate-notes.result == 'success' && needs.build-and-push.result == 'success' && needs.generate-notes.outputs.predicted_version != '' }}
|
||||
needs: [resolve_ref, build-and-push, generate-notes]
|
||||
if: ${{ always() && needs.generate-notes.result == 'success' && needs.build-and-push.result == 'success' && needs.export-openapi.result == 'success' && needs.generate-notes.outputs.predicted_version != '' }}
|
||||
needs: [resolve_ref, build-and-push, export-openapi, generate-notes]
|
||||
permissions: {}
|
||||
uses: ./.github/workflows/notify-discord-release-notes.yml
|
||||
secrets:
|
||||
|
||||
Reference in New Issue
Block a user