Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(docs): get openapi version from .version file if it exists #118

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/publish-openapi-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: publish swagger ui

on:
workflow_call:
inputs:
version:
required: false
description: "version override"
type: string

jobs:
generate-openapi-spec:
Expand Down Expand Up @@ -45,9 +40,15 @@ jobs:
name: openapi-spec
path: resources/openapi/yaml

- name: Override version if input is set
if: "${{ inputs.version != '' }}"
run: sed -i "s/version=.*/version=${{ inputs.version }}/g" gradle.properties
- name: Get version from .version file
run: |
if [ -f resources/openapi/${{ matrix.apiGroup }}.version ]; then
VERSION=$(cat resources/openapi/${{ matrix.apiGroup }}.version | xargs cat | grep version | awk {'print $2'} | rev | cut -c3- | rev | cut -c2-)
sed -i "s/version=.*/version=$VERSION/g" gradle.properties
echo "${{ matrix.apiGroup }} will be published with version $VERSION"
else
echo "No version.json file found for ${{ matrix.apiGroup }} api context"
fi

- uses: eclipse-edc/.github/.github/actions/setup-build@main

Expand Down
Loading