Skip to content

Commit

Permalink
build(docs): get openapi version from .version file if it exists (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt authored Jun 20, 2024
1 parent ea2fd32 commit a9f67cc
Showing 1 changed file with 9 additions and 8 deletions.
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

0 comments on commit a9f67cc

Please sign in to comment.