Skip to content

Commit df42fa2

Browse files
committed
feat: add yaml path
feat: change installation of openapi generator over wget instead of NPM
1 parent 63c6464 commit df42fa2

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

.github/workflows/publish.yaml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,28 @@ jobs:
3030
echo "Latest MFD tag: $MFD_TAG"
3131
gh api /repos/cloudbeds/mfd/tarball/$MFD_TAG | tar --strip-components=1 --wildcards -zxf - '*/public_accessa'
3232
33-
- name: Setup NPM
34-
uses: actions/setup-node@v2
33+
- name: Set path to yaml file
34+
id: set-path-to-yaml
35+
run: |
36+
if [ "${{ github.ref_name }}" == "release/v1" ]; then
37+
echo "yaml_path=public_accessa/api/v1.2/docs/cb-v1.2-openapi-3.0.1.yaml" >> $GITHUB_ENV
38+
else
39+
echo "yaml_path=public_accessa/api/v2/docs/cb-v2-openapi-3.0.0.yaml" >> $GITHUB_ENV
40+
fi
41+
42+
- name: Setup Java
43+
uses: actions/setup-java@v4
3544
with:
36-
node-version: '22'
45+
java-version: 21
46+
distribution: corretto
47+
48+
- name: Install OpenAPI generator
49+
run: |
50+
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-$(cat .openapi-generator/VERSION).jar -O openapi-generator-cli.jar
3751
3852
- name: Generate API docs
3953
run: |
40-
npm install @openapitools/openapi-generator-cli -g
41-
openapi-generator-cli version-manager $(cat .openapi-generator/VERSION)
42-
# TODO - change file name based on branch (main or release/v1)
43-
openapi-generator-cli generate -i public_accessa/api/v2/docs/cb-v2-openapi-3.0.0.yaml -c openapitools.json
44-
rm -rf public_accessa
54+
java -jar openapi-generator-cli.jar generate -i ${{ env.yaml_path }} -c openapitools.json
4555
4656
- name: Get next version
4757
id: get_next_version
@@ -52,12 +62,12 @@ jobs:
5262
else
5363
current_version=$(cat VERSION)
5464
echo "Current version: $current_version"
55-
65+
5666
IFS='.' read -r major minor patch <<< "$current_version"
5767
minor=$((minor + 1))
5868
next_version="$major.$minor.$patch"
5969
echo "Next version: $next_version"
60-
70+
6171
echo "next_version=$next_version" >> $GITHUB_ENV
6272
fi
6373
@@ -94,7 +104,7 @@ jobs:
94104
env:
95105
GITHUB_TOKEN: ${{ github.token }}
96106
run: >-
97-
gh release create '${{ env.next_version }}'
107+
gh release create '${{ env.next_version }}'
98108
--notes '${{ env.next_version }}'
99109
--target '${{ github.ref_name }}'
100110
--title '${{ env.next_version }}'

0 commit comments

Comments
 (0)