diff --git a/.github/workflows/release-post-only.yml b/.github/workflows/release-post-only.yml deleted file mode 100644 index 6fe501a9ce..0000000000 --- a/.github/workflows/release-post-only.yml +++ /dev/null @@ -1,132 +0,0 @@ -# TEMPORARY: re-runs only the post-release part of release.yml (CI/post-release.sh and the steps after it) -# for a release whose Maven deploy already succeeded. Remove once the release is completed. -name: Release - post release only (temporary) - -on: - workflow_dispatch: - inputs: - version: - description: 'Released version (must match the version on master)' - required: true - default: '2.2.56' - next_version: - description: 'Next version (without -SNAPSHOT)' - required: true - default: '2.2.57' - last_release: - description: 'Previous v2 release (used for 1.5 readme and wiki updates)' - required: true - default: '2.2.55' - release_commit: - description: 'Commit to tag as v (the "prepare release" commit)' - required: true - default: 'a843d54f3b6dd68c1926dc8644628578cd0e24cc' - -jobs: - post-release: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v7 - with: - ref: "master" - fetch-depth: 0 - - uses: actions/create-github-app-token@v3 - id: generate-token - with: - client-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - - name: Set up Python - uses: actions/setup-python@v7 - with: - python-version: '3.14' - # com.gradle.plugin-publish 2.x (used by publishPlugins in post-release.sh) requires a Java 17+ runtime - - name: Set up Java 17 - uses: actions/setup-java@v5 - with: - java-version: 17 - distribution: temurin - - name: Cache local Maven repository - uses: actions/cache@v6 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: configure git user email - run: | - git config --global user.email "action@github.com" - git config --global user.name "GitHub Action" - - name: Check versions on master - run: | - ROOT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) - GRADLE_VERSION=$(grep '^version=' modules/swagger-gradle-plugin/gradle.properties | cut -d= -f2) - echo "Root version: ${ROOT_VERSION}" - echo "Gradle plugin version: ${GRADLE_VERSION}" - if [ "${ROOT_VERSION}" != "${SC_VERSION}" ] || [ "${GRADLE_VERSION}" != "${SC_VERSION}" ]; then - echo "ERROR: master is not at release version ${SC_VERSION}." - exit 1 - fi - # publishRelease.py (called by post-release.sh) targets master, whose HEAD is no longer the released commit; - # creating the tag first makes GitHub publish the release on the existing tag instead - - name: Create release tag - env: - RELEASE_COMMIT: ${{ inputs.release_commit }} - run: | - if git ls-remote --exit-code --tags origin "refs/tags/v${SC_VERSION}" > /dev/null; then - echo "Tag v${SC_VERSION} already exists" - exit 0 - fi - git merge-base --is-ancestor "${RELEASE_COMMIT}" HEAD || { echo "ERROR: ${RELEASE_COMMIT} is not on master"; exit 1; } - git show "${RELEASE_COMMIT}:pom.xml" | grep -q "${SC_VERSION}" || { echo "ERROR: ${RELEASE_COMMIT} is not at version ${SC_VERSION}"; exit 1; } - gh api "repos/${GITHUB_REPOSITORY}/git/refs" -f ref="refs/tags/v${SC_VERSION}" -f sha="${RELEASE_COMMIT}" - - name: Run post release script - id: postRelease - run: | - . ./CI/post-release.sh - - name: Create Next Snapshot Pull Request - uses: peter-evans/create-pull-request@v8 - with: - token: ${{ steps.generate-token.outputs.token }} - commit-message: bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT - title: 'bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT' - branch: bump-snap-${{ env.SC_NEXT_VERSION }}-SNAPSHOT - - name: Checkout 1.5 - uses: actions/checkout@v7 - with: - ref: "1.5" - fetch-depth: 0 - - name: updateV1Readme script - id: updateV1Readme - run: | - TMPDIR="$(dirname -- "${0}")" - . $TMPDIR/update-v1-readme.sh ${{ env.SC_LAST_RELEASE }} ${{ env.SC_VERSION }} - - name: Create Update V1 Readme Pull Request - uses: peter-evans/create-pull-request@v8 - with: - token: ${{ steps.generate-token.outputs.token }} - commit-message: update 1.5 Readme with new v2 version ${{ env.SC_VERSION }} - title: 'update 1.5 Readme with new v2 version ${{ env.SC_VERSION }}' - branch: update-v1-readme-${{ env.SC_VERSION }} - - name: Checkout Wiki - uses: actions/checkout@v7 - with: - repository: swagger-api/swagger-core.wiki - token: ${{ steps.generate-token.outputs.token }} - path: wiki - ref: "master" - fetch-depth: 0 - - name: Run update wiki script - id: updateWiki - run: | - TMPDIR="$(dirname -- "${0}")" - . $TMPDIR/update-wiki.sh - - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SC_VERSION: ${{ inputs.version }} - SC_NEXT_VERSION: ${{ inputs.next_version }} - SC_LAST_RELEASE: ${{ inputs.last_release }} - GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} - GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}