diff --git a/.github/workflows/maven-pulls.yml b/.github/workflows/maven-pulls.yml new file mode 100644 index 00000000..6004ae99 --- /dev/null +++ b/.github/workflows/maven-pulls.yml @@ -0,0 +1,30 @@ +name: Build Test PR + +on: + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 11 ] + + steps: + - uses: actions/checkout@v2 + - name: Set up Java + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven + run: | + mvn --no-transfer-progress -B install --file pom.xml \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..e622cc1f --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,36 @@ +name: Build Test master + +on: + push: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 11 ] + + steps: + - uses: actions/checkout@v2 + - name: Set up Java + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven + run: | + mvn --no-transfer-progress -B install --file pom.xml + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a60f9103..e24d01bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,7 +70,7 @@ jobs: branch: bump-snap-${{ env.SC_NEXT_VERSION }}-SNAPSHOT - name: deploy docker run: | - SC_RELEASE_TAG="v${{ env.SC_VERSION }}" + SC_RELEASE_TAG="${{ env.SC_VERSION }}" echo "$SC_RELEASE_TAG" TOKEN="${{ secrets.RANCHER2_BEARER_TOKEN }}" @@ -78,8 +78,8 @@ jobs: CLUSTER_ID="c-n8zp2" NAMESPACE_NAME="swagger-oss" K8S_OBJECT_TYPE="daemonsets" - K8S_OBJECT_NAME="swagger-petstore3" - DEPLOY_IMAGE="swaggerapi/swagger-petstore3:$SC_RELEASE_TAG" + K8S_OBJECT_NAME="swagger-petstore-3" + DEPLOY_IMAGE="swaggerapi/petstore3:$SC_RELEASE_TAG" workloadStatus="" getStatus() { diff --git a/CI/docker-release.sh b/CI/docker-release.sh index 993f5c6b..faa973d1 100755 --- a/CI/docker-release.sh +++ b/CI/docker-release.sh @@ -2,7 +2,7 @@ CUR=$(pwd) -SC_RELEASE_TAG="v$SC_VERSION" +SC_RELEASE_TAG="$SC_VERSION" echo "docker tag:" echo "$SC_RELEASE_TAG" diff --git a/CI/lastRelease.py b/CI/lastRelease.py index c56832b0..ddabddf0 100755 --- a/CI/lastRelease.py +++ b/CI/lastRelease.py @@ -7,9 +7,10 @@ def getLastReleaseTag(): for l in content: draft = l["draft"] tag = l["tag_name"] - if str(draft) != 'True' and tag.startswith("v2"): - return tag[1:] - return "v2.1.3" + if str(draft) != 'True' and tag.startswith("swagger-petstore-v3-"): + return tag + print ("NO RELEASE TAG FOUND, using default swagger-petstore-v3-1.0.17") + return "swagger-petstore-v3-1.0.17" # main def main(): result = getLastReleaseTag() diff --git a/CI/post-release.sh b/CI/post-release.sh index 1b42baef..d39f3292 100755 --- a/CI/post-release.sh +++ b/CI/post-release.sh @@ -3,7 +3,7 @@ CUR=$(pwd) TMPDIR="$(dirname -- "${0}")" -SC_RELEASE_TAG="v$SC_VERSION" +SC_RELEASE_TAG="swagger-petstore-v3-$SC_VERSION" ##################### ### publish pre-prepared release (tag is created) diff --git a/CI/pre-release.sh b/CI/pre-release.sh index c4da53de..95746f76 100755 --- a/CI/pre-release.sh +++ b/CI/pre-release.sh @@ -9,7 +9,7 @@ SC_QUALIFIER=`mvn -q -Dexec.executable="echo" -Dexec.args='${parsedVersion.quali SC_LAST_RELEASE=`python $CUR/CI/lastRelease.py` -SC_RELEASE_TAG="v$SC_VERSION" +SC_RELEASE_TAG="$SC_VERSION" ##################### diff --git a/CI/prepare-release.sh b/CI/prepare-release.sh index b103a3ef..0d882750 100755 --- a/CI/prepare-release.sh +++ b/CI/prepare-release.sh @@ -10,8 +10,8 @@ SC_LAST_RELEASE=`python $CUR/CI/lastRelease.py` -SC_RELEASE_TITLE="Swagger-Petstore $SC_VERSION released!" -SC_RELEASE_TAG="v$SC_VERSION" +SC_RELEASE_TITLE="Swagger Petstore OpenAPI 3.0 release $SC_VERSION" +SC_RELEASE_TAG="swagger-petstore-v3-$SC_VERSION" echo "SC_VERSION: $SC_VERSION" echo "SC_NEXT_VERSION: $SC_NEXT_VERSION" @@ -24,6 +24,13 @@ echo "SC_RELEASE_TAG: $SC_RELEASE_TAG" ##################### python $CUR/CI/releaseNotes.py "$SC_LAST_RELEASE" "$SC_RELEASE_TITLE" "$SC_RELEASE_TAG" +##################### +### update version in openapi.yaml file ### +##################### +sc_find="version\: $SC_VERSION\-SNAPSHOT" +sc_replace="version: $SC_VERSION" +sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/resources/openapi.yaml + ##################### ### build and test maven ### ##################### diff --git a/CI/releaseNotes.py b/CI/releaseNotes.py index 8f8b9bcd..c933f92c 100755 --- a/CI/releaseNotes.py +++ b/CI/releaseNotes.py @@ -44,7 +44,7 @@ def getReleases(): # main def main(last_release, release_title, tag): - result = allPulls(lastReleaseDate('v' + last_release)) + result = allPulls(lastReleaseDate(last_release)) addRelease (release_title, tag, result) # here start main diff --git a/pom.xml b/pom.xml index 51466520..230ad271 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ swagger-petstore war swagger-petstore - 1.0.17 + 1.0.18-SNAPSHOT 2.2.0 diff --git a/src/main/resources/openapi.yaml b/src/main/resources/openapi.yaml index 73697c1b..5b2ef7a1 100644 --- a/src/main/resources/openapi.yaml +++ b/src/main/resources/openapi.yaml @@ -11,7 +11,7 @@ info: Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml) - version: 1.0.17 + version: 1.0.18-SNAPSHOT title: Swagger Petstore - OpenAPI 3.0 termsOfService: 'http://swagger.io/terms/' contact: