-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1734 from ballerina-platform/oas-gen-svc-type
Add service contract type support in OpenAPI tool
- Loading branch information
Showing
101 changed files
with
1,750 additions
and
1,650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'ballerina-platform' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17.0.7 | ||
- name: Change to Timestamped Version | ||
run: | | ||
startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00') | ||
latestCommit=$(git log -n 1 --pretty=format:"%h") | ||
VERSION=$((grep -w 'ballerinaToOpenAPIVersion' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev) | ||
updatedVersion=$VERSION-$startTime-$latestCommit | ||
echo $updatedVersion | ||
sed -i "s/ballerinaToOpenAPIVersion=\(.*\)/ballerinaToOpenAPIVersion=$updatedVersion/g" gradle.properties | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
env: | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
nexusUser: ${{ secrets.NEXUS_USERNAME }} | ||
nexusPassword: ${{ secrets.NEXUS_PASSWORD }} | ||
run: | | ||
./gradlew clean build :ballerina-to-openapi:publish --stacktrace --scan --console=plain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This workflow is to publish the Ballerina to OpenAPI package to the GitHub. | ||
# This has to be run before releasing the openapi-tool, since the http package | ||
# depends on the Ballerina to OpenAPI package. | ||
name: Publish Ballerina to OpenAPI package | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17.0.7 | ||
- name: Set version env variable | ||
run: echo "VERSION=$((grep -w "ballerinaToOpenAPIVersion" | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)" >> $GITHUB_ENV | ||
- name: Pre release dependency version update | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
echo "Version: ${VERSION}" | ||
git config user.name ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
git config user.email ${{ secrets.BALLERINA_BOT_EMAIL }} | ||
git checkout -b ballerina-to-openapi-release-${VERSION} | ||
sed -i 's/ballerinaToOpenAPIVersion=\(.*\)-SNAPSHOT/ballerinaToOpenAPIVersion=\1/g' gradle.properties | ||
sed -i 's/ballerinaLangVersion=\(.*\)-SNAPSHOT/ballerinaLangVersion=\1/g' gradle.properties | ||
sed -i 's/ballerinaLangVersion=\(.*\)-[0-9]\{8\}-[0-9]\{6\}-.*$/ballerinaLangVersion=\1/g' gradle.properties | ||
git add gradle.properties | ||
git commit -m "Move dependencies to stable version" || echo "No changes to commit" | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Publish artifact | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
./gradlew :ballerina-to-openapi:publish | ||
- name: Post release PR | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
bin/hub pull-request -m "[Automated] Sync master after ballerina-to-openapi:$VERSION release" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ballerina-to-openapi/src/main/java/io/ballerina/openapi/service/mapper/ResourceMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.