Skip to content

Commit

Permalink
chore(workflow): generate and upload OpenAPI schema when releases are…
Browse files Browse the repository at this point in the history
… created
  • Loading branch information
nicomiguelino committed Nov 19, 2024
1 parent e06648b commit 931ac09
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-balena-disk-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ on:
default: 'master'

jobs:
generate-openapi-schema:
uses: ./.github/workflows/generate-openapi-schema.yml
with:
release: true
tag: ${{ inputs.tag }}
commit: ${{ inputs.commit }}
balena-build-images:
strategy:
matrix:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/generate-openapi-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ on:
- '!bin/install.sh'
- '!bin/upgrade_containers.sh'
- '!tests/**'
workflow_call:
inputs:
release:
description: 'Upload the OpenAPI schema as a release artifact'
required: true
type: boolean
default: false
tag:
description: 'Tag to be used for the release'
required: true
type: string
commit:
description: 'Commit or branch name'
required: false
type: string
default: 'master'

jobs:
generate-openapi-schema:
Expand Down Expand Up @@ -92,3 +108,14 @@ jobs:
with:
name: anthias-api-schema
path: anthias-api-schema.json

- name: Upload the OpenAPI Schema as a release artifact
if: ${{ github.event_name == 'workflow_call' && inputs.release == true }}
uses: ncipollo/[email protected]
with:
allowUpdates: true
prerelease: true
artifacts: anthias-api-schema.json
tag: ${{ inputs.tag }}
commit: ${{ inputs.commit }}

0 comments on commit 931ac09

Please sign in to comment.