diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ec580d19..cea99809 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -5,7 +5,7 @@ on: branches: ["v31"] pull_request: # The branches below must be a subset of the branches above - branches: ["master"] + branches: ["v31"] schedule: - cron: '0 19 * * 1' diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml index e3da0978..f99f7245 100644 --- a/.github/workflows/deploy-docker.yml +++ b/.github/workflows/deploy-docker.yml @@ -24,7 +24,7 @@ jobs: NAMESPACE_NAME="swagger-oss" K8S_OBJECT_TYPE="daemonsets" K8S_OBJECT_NAME="swagger-petstore-31" - DEPLOY_IMAGE="swaggerapi/swagger-petstore31:$SC_RELEASE_TAG" + DEPLOY_IMAGE="swaggerapi/petstore31:$SC_RELEASE_TAG" workloadStatus="" getStatus() { diff --git a/CI/docker-release.sh b/CI/docker-release.sh index 645801c8..0cbf0212 100755 --- a/CI/docker-release.sh +++ b/CI/docker-release.sh @@ -13,4 +13,4 @@ docker tag $DOCKER_PETSTORE_IMAGE_NAME:$SC_RELEASE_TAG $DOCKER_PETSTORE_IMAGE_NA docker push $DOCKER_PETSTORE_IMAGE_NAME:$SC_RELEASE_TAG docker push $DOCKER_PETSTORE_IMAGE_NAME:latest echo "docker images:" -docker images | grep -i petstore3 +docker images | grep -i petstore31 diff --git a/CI/post-release.sh b/CI/post-release.sh index d383f440..1e5f81d1 100755 --- a/CI/post-release.sh +++ b/CI/post-release.sh @@ -20,12 +20,20 @@ mvn versions:commit ### update all other versions in files around to the next snapshot or new release, including readme and gradle ### ##################### -sc_find="version\: $SC_VERSION" -sc_replace="version: $SC_NEXT_VERSION-SNAPSHOT" +sc_find="version: $SC_VERSION" +sc_replace="version\: $SC_SC_NEXT_VERSION\-SNAPSHOT" +sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/design-first/petstore.yaml + + +sc_find="version: $SC_VERSION" +sc_replace="version\: $SC_SC_NEXT_VERSION\-SNAPSHOT" sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/code-first/openapi.yaml +sc_find="\"version\" \: \"$SC_VERSION\"" +sc_replace="\"version \: \"$SC_SC_NEXT_VERSION\-SNAPSHOT\"" +sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/code-first/openapi.json -sc_find="version\: $SC_VERSION" -sc_replace="version: $SC_NEXT_VERSION-SNAPSHOT" -sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/design-first/petstore.yaml +sc_find="\"version\" \: \"$SC_VERSION\"" +sc_replace="\"version \: \"$SC_NEXT_VERSION\-SNAPSHOT\"" +sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/java/io/swagger/petstore/resource/DefinitionResource.java diff --git a/CI/prepare-release.sh b/CI/prepare-release.sh index 3994f835..f59ec0da 100755 --- a/CI/prepare-release.sh +++ b/CI/prepare-release.sh @@ -38,11 +38,19 @@ sc_replace="version: $SC_VERSION" sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/design-first/petstore.yaml - sc_find="version\: $SC_VERSION\-SNAPSHOT" sc_replace="version: $SC_VERSION" sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/code-first/openapi.yaml + +sc_find="\"version \: \"$SC_VERSION\-SNAPSHOT\"" +sc_replace="\"version\" \: \"$SC_VERSION\"" +sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/webapp/code-first/openapi.json + +sc_find="\"version \: \"$SC_VERSION\-SNAPSHOT\"" +sc_replace="\"version\" \: \"$SC_VERSION\"" +sed -i -e "s/$sc_find/$sc_replace/g" $CUR/src/main/java/io/swagger/petstore/resource/DefinitionResource.java + ##################### ### build and test maven ### ##################### diff --git a/CI/publishRelease.py b/CI/publishRelease.py index 3c762903..40db50e2 100755 --- a/CI/publishRelease.py +++ b/CI/publishRelease.py @@ -15,7 +15,7 @@ def publishRelease(tag): id = lastReleaseId(tag) payload = "{\"tag_name\":\"" + tag + "\", " payload += "\"draft\":" + "false" + ", " - payload += "\"target_commitish\":\"" + "master" + "\"}" + payload += "\"target_commitish\":\"" + "v31" + "\"}" content = ghApiClient.postUrl('repos/swagger-api/swagger-petstore/releases/' + str(id), payload) return content diff --git a/CI/releaseNotes.py b/CI/releaseNotes.py index c933f92c..26c842d2 100755 --- a/CI/releaseNotes.py +++ b/CI/releaseNotes.py @@ -10,7 +10,7 @@ def allPulls(releaseDate): result = "" baseurl = "https://api.github.com/repos/swagger-api/swagger-petstore/pulls/" - content = ghApiClient.readUrl('repos/swagger-api/swagger-petstore/pulls?state=closed&base=master&per_page=100') + content = ghApiClient.readUrl('repos/swagger-api/swagger-petstore/pulls?state=closed&base=v31&per_page=100') for l in content: stripped = l["url"][len(baseurl):] mergedAt = l["merged_at"] @@ -34,7 +34,7 @@ def addRelease(release_title, tag, content): payload += "\"body\":" + json.dumps(content) + ", " payload += "\"draft\":" + "true" + ", " payload += "\"prerelease\":" + "false" + ", " - payload += "\"target_commitish\":\"" + "master" + "\"}" + payload += "\"target_commitish\":\"" + "v31" + "\"}" content = ghApiClient.postUrl('repos/swagger-api/swagger-petstore/releases', payload) return content diff --git a/src/main/java/io/swagger/petstore/resource/DefinitionResource.java b/src/main/java/io/swagger/petstore/resource/DefinitionResource.java index ac66f611..2a38b34e 100644 --- a/src/main/java/io/swagger/petstore/resource/DefinitionResource.java +++ b/src/main/java/io/swagger/petstore/resource/DefinitionResource.java @@ -22,7 +22,7 @@ info = @Info( title = "Swagger Petstore - OpenAPI 3.1", summary = "Pet Store 3.1", - version = "1.0.3", + version = "1.0.3-SNAPSHOT", description = "This is a sample Pet Store Server based on the OpenAPI 3.1 specification.\nYou can find out more about\nSwagger at [http://swagger.io](http://swagger.io).", termsOfService = "http://swagger.io/terms/", contact = @Contact ( diff --git a/src/main/webapp/code-first/openapi.json b/src/main/webapp/code-first/openapi.json index 7303c0ca..0430fba1 100644 --- a/src/main/webapp/code-first/openapi.json +++ b/src/main/webapp/code-first/openapi.json @@ -11,7 +11,7 @@ "name" : "Apache 2.0 AND (MIT OR GPL-2.0-only)", "identifier" : "Apache-2.0 AND (MIT OR GPL-2.0-only)" }, - "version" : "1.0.3", + "version" : "1.0.3-SNAPSHOT", "summary" : "Pet Store 3.1", "x-namespace" : "swagger" },