From a0f1d59528d1bbe19beec41e59593d6eaf64c541 Mon Sep 17 00:00:00 2001 From: Daniel Kmiecik Date: Thu, 5 Nov 2026 13:56:47 +0100 Subject: [PATCH] chore: update setup-java action --- .github/workflows/maven-pulls-v3.yml | 6 +- .github/workflows/maven-pulls.yml | 34 --------- .github/workflows/maven-v1-pulls.yml | 30 -------- .github/workflows/maven-v1.yml | 45 ------------ .github/workflows/maven-v3.yml | 8 ++- .github/workflows/maven.yml | 54 -------------- .github/workflows/next-snapshot-v1.yml | 87 ---------------------- .github/workflows/next-snapshot.yml | 87 ---------------------- .github/workflows/prepare-release-v1.yml | 66 ----------------- .github/workflows/prepare-release.yml | 66 ----------------- .github/workflows/release-v1.yml | 91 ------------------------ .github/workflows/release.yml | 87 ---------------------- 12 files changed, 8 insertions(+), 653 deletions(-) delete mode 100644 .github/workflows/maven-pulls.yml delete mode 100644 .github/workflows/maven-v1-pulls.yml delete mode 100644 .github/workflows/maven-v1.yml delete mode 100644 .github/workflows/maven.yml delete mode 100644 .github/workflows/next-snapshot-v1.yml delete mode 100644 .github/workflows/next-snapshot.yml delete mode 100644 .github/workflows/prepare-release-v1.yml delete mode 100644 .github/workflows/prepare-release.yml delete mode 100644 .github/workflows/release-v1.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/maven-pulls-v3.yml b/.github/workflows/maven-pulls-v3.yml index b87478036c..6ea2194332 100644 --- a/.github/workflows/maven-pulls-v3.yml +++ b/.github/workflows/maven-pulls-v3.yml @@ -16,13 +16,13 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v6.2.0 with: java-version: ${{ matrix.java }} distribution: temurin server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD + server-username-env-var: MAVEN_USERNAME + server-password-env-var: MAVEN_PASSWORD - name: Cache local Maven repository uses: actions/cache@v4 with: diff --git a/.github/workflows/maven-pulls.yml b/.github/workflows/maven-pulls.yml deleted file mode 100644 index 847110e2a9..0000000000 --- a/.github/workflows/maven-pulls.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build Test PR - -on: - pull_request: - branches: [ "master" ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ 11, 17 ] - - steps: - - uses: actions/checkout@v4 - - name: Set up Java - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java }} - distribution: temurin - server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Cache local Maven repository - uses: actions/cache@v4 - 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 diff --git a/.github/workflows/maven-v1-pulls.yml b/.github/workflows/maven-v1-pulls.yml deleted file mode 100644 index 56b5a0aa30..0000000000 --- a/.github/workflows/maven-v1-pulls.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build Test PR v1 - -on: - pull_request: - branches: [ "v1" ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ 8 ] - - steps: - - uses: actions/checkout@v6 - - name: Set up Java - uses: actions/setup-java@v5 - with: - java-version: ${{ matrix.java }} - distribution: temurin - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Build with Maven - run: mvn -B verify --file pom.xml diff --git a/.github/workflows/maven-v1.yml b/.github/workflows/maven-v1.yml deleted file mode 100644 index 85041a48c5..0000000000 --- a/.github/workflows/maven-v1.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Build Test Deploy v1 - -on: - push: - branches: [ "v1" ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ 8 ] - - steps: - - uses: actions/checkout@v6 - - name: Set up Java - uses: actions/setup-java@v5 - with: - java-version: ${{ matrix.java }} - distribution: temurin - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Build with Maven, Deploy snapshot to maven central - run: | - mvn --no-transfer-progress -B verify --file pom.xml - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - echo "POM VERSION" ${MY_POM_VERSION} - if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; - then - mvn --no-transfer-progress -B clean deploy - else - echo "not deploying release: " ${MY_POM_VERSION} - fi - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} diff --git a/.github/workflows/maven-v3.yml b/.github/workflows/maven-v3.yml index a8ed615040..d0c1ff1359 100644 --- a/.github/workflows/maven-v3.yml +++ b/.github/workflows/maven-v3.yml @@ -16,13 +16,15 @@ jobs: steps: - uses: actions/checkout@v6 - name: Set up Java - uses: actions/setup-java@v5 + uses: actions/setup-java@v6.2.0 with: java-version: ${{ matrix.java }} distribution: temurin server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD + server-username-env-var: MAVEN_USERNAME + server-password-env-var: MAVEN_PASSWORD + mvn-server-repository-origins: | + central:https://central.sonatype.com - name: Cache local Maven repository uses: actions/cache@v5 with: diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 68d0bbba56..0000000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Build Test Deploy master - -on: - push: - branches: [ "master" ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ 11, 17 ] - - steps: - - uses: actions/checkout@v6 - - name: Set up Java - uses: actions/setup-java@v5 - with: - java-version: ${{ matrix.java }} - distribution: temurin - server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Build with Maven, Deploy snapshot to maven central - run: | - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - echo "POM VERSION" ${MY_POM_VERSION} - if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; - then - mvn --no-transfer-progress -B install --file pom.xml - export MY_JAVA_VERSION=`java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1` - echo "JAVA VERSION" ${MY_JAVA_VERSION} - if [[ ${MY_JAVA_VERSION} == "11" ]]; - then - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - echo "POM VERSION" ${MY_POM_VERSION} - mvn --no-transfer-progress -B clean deploy - else - echo "not deploying on java version: " ${MY_JAVA_VERSION} - fi - else - echo "not building and maven publishing project as it is a release version: " ${MY_JAVA_VERSION} - fi - env: - MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} diff --git a/.github/workflows/next-snapshot-v1.yml b/.github/workflows/next-snapshot-v1.yml deleted file mode 100644 index 8ca9b1bebb..0000000000 --- a/.github/workflows/next-snapshot-v1.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Next Snapshot V1 - -on: - workflow_dispatch: - branches: ["v1"] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - 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 3.10 - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Set up Java 8 - uses: actions/setup-java@v5 - with: - java-version: 8 - distribution: temurin - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Run pre release script - id: preRelease - run: | - # export GPG_TTY=$(tty) - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; - then - echo "not releasing snapshot version: " ${MY_POM_VERSION} - echo "RELEASE_OK=no" >> $GITHUB_ENV - else - . ./CI/pre-release-v1.sh - echo "RELEASE_OK=yes" >> $GITHUB_ENV - fi - echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV - echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV - echo "SC_LAST_RELEASE=$SC_LAST_RELEASE" >> $GITHUB_ENV - - name: configure git user email - run: | - git config --global user.email "action@github.com" - git config --global user.name "GitHub Action" - git config --global hub.protocol https - git remote set-url origin https://\${{ secrets.GITHUB_TOKEN }}:x-oauth-basic@github.com/swagger-api/swagger-parser.git - - name: Checkout v1 - uses: actions/checkout@v6 - with: - ref: "v1" - fetch-depth: 0 - - name: Run next snapshot script - id: postRelease - if: env.RELEASE_OK == 'yes' - run: | - . ./CI/post-nextsnap-v1.sh - - name: Create Next Snapshot Pull Request - uses: peter-evans/create-pull-request@v8 - if: env.RELEASE_OK == 'yes' - 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 - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SC_VERSION: - SC_NEXT_VERSION: - GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PRIVATE_PASSPHRASE }} diff --git a/.github/workflows/next-snapshot.yml b/.github/workflows/next-snapshot.yml deleted file mode 100644 index 4cc69f9037..0000000000 --- a/.github/workflows/next-snapshot.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Next Snapshot - -on: - workflow_dispatch: - branches: ["master"] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - 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 3.10 - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Set up Java 11 - uses: actions/setup-java@v5 - with: - java-version: 11 - distribution: temurin - server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Run pre release script - id: preRelease - run: | - # export GPG_TTY=$(tty) - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; - then - echo "not releasing snapshot version: " ${MY_POM_VERSION} - echo "RELEASE_OK=no" >> $GITHUB_ENV - else - . ./CI/pre-release.sh - echo "RELEASE_OK=yes" >> $GITHUB_ENV - fi - echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV - echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV - echo "SC_LAST_RELEASE=$SC_LAST_RELEASE" >> $GITHUB_ENV - - name: configure git user email - run: | - git config --global user.email "action@github.com" - git config --global user.name "GitHub Action" - git config --global hub.protocol https - git remote set-url origin https://\${{ secrets.GITHUB_TOKEN }}:x-oauth-basic@github.com/swagger-api/swagger-parser.git - - name: Checkout master - uses: actions/checkout@v6 - with: - ref: "master" - fetch-depth: 0 - - name: Run next snapshot script - id: postRelease - if: env.RELEASE_OK == 'yes' - run: | - . ./CI/post-nextsnap.sh - - name: Create Next Snapshot Pull Request - uses: peter-evans/create-pull-request@v8 - if: env.RELEASE_OK == 'yes' - 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 - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SC_VERSION: - SC_NEXT_VERSION: - GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PRIVATE_PASSPHRASE }} diff --git a/.github/workflows/prepare-release-v1.yml b/.github/workflows/prepare-release-v1.yml deleted file mode 100644 index 8b6dcb03a8..0000000000 --- a/.github/workflows/prepare-release-v1.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Prepare Release V1 - -on: - workflow_dispatch: - branches: ["v1"] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - 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 3.10 - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Set up Java 8 - uses: actions/setup-java@v5 - with: - java-version: 8 - distribution: temurin - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Run prepare release script - id: prepare-release - run: | - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; - then - . ./CI/prepare-release-v1.sh - echo "PREPARE_RELEASE_OK=yes" >> $GITHUB_ENV - else - echo "not preparing release for release version: " ${MY_POM_VERSION} - echo "PREPARE_RELEASE_OK=no" >> $GITHUB_ENV - fi - echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV - echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV - - name: Create Prepare Release Pull Request - uses: peter-evans/create-pull-request@v8 - if: env.PREPARE_RELEASE_OK == 'yes' - with: - token: ${{ steps.generate-token.outputs.token }} - commit-message: prepare release ${{ env.SC_VERSION }} - title: 'prepare release ${{ env.SC_VERSION }}' - branch: prepare-release-${{ env.SC_VERSION }} - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SC_VERSION: - SC_NEXT_VERSION: diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml deleted file mode 100644 index 974871cd61..0000000000 --- a/.github/workflows/prepare-release.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Prepare Release - -on: - workflow_dispatch: - branches: ["master"] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - 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 3.10 - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Set up Java 11 - uses: actions/setup-java@v5 - with: - java-version: 11 - distribution: temurin - server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Run prepare release script - id: prepare-release - run: | - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; - then - . ./CI/prepare-release.sh - echo "PREPARE_RELEASE_OK=yes" >> $GITHUB_ENV - else - echo "not preparing release for release version: " ${MY_POM_VERSION} - echo "PREPARE_RELEASE_OK=no" >> $GITHUB_ENV - fi - echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV - echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV - - name: Create Prepare Release Pull Request - uses: peter-evans/create-pull-request@v8 - if: env.PREPARE_RELEASE_OK == 'yes' - with: - token: ${{ steps.generate-token.outputs.token }} - commit-message: prepare release ${{ env.SC_VERSION }} - title: 'prepare release ${{ env.SC_VERSION }}' - branch: prepare-release-${{ env.SC_VERSION }} - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SC_VERSION: - SC_NEXT_VERSION: diff --git a/.github/workflows/release-v1.yml b/.github/workflows/release-v1.yml deleted file mode 100644 index c023f8ad9a..0000000000 --- a/.github/workflows/release-v1.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Release V1 - -on: - workflow_dispatch: - branches: ["v1"] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - 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 3.10 - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Set up Java 8 - uses: actions/setup-java@v5 - with: - java-version: 8 - distribution: temurin - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Run pre release script - id: preRelease - run: | - # export GPG_TTY=$(tty) - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; - then - echo "not releasing snapshot version: " ${MY_POM_VERSION} - echo "RELEASE_OK=no" >> $GITHUB_ENV - else - . ./CI/pre-release-v1.sh - echo "RELEASE_OK=yes" >> $GITHUB_ENV - fi - echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV - echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV - echo "SC_LAST_RELEASE=$SC_LAST_RELEASE" >> $GITHUB_ENV - - name: configure git user email - run: | - git config --global user.email "action@github.com" - git config --global user.name "GitHub Action" - git config --global hub.protocol https - git remote set-url origin https://\${{ secrets.GITHUB_TOKEN }}:x-oauth-basic@github.com/swagger-api/swagger-parser.git - - name: Run maven deploy/release (action-maven-publish) - uses: samuelmeuli/action-maven-publish@v1 - if: env.RELEASE_OK == 'yes' - with: - gpg_private_key: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.OSSRH_GPG_PRIVATE_PASSPHRASE }} - nexus_username: ${{ secrets.OSSRH_USERNAME }} - nexus_password: ${{ secrets.OSSRH_TOKEN }} - maven_profiles: "release" - - name: Run post release script - id: postRelease - if: env.RELEASE_OK == 'yes' - run: | - . ./CI/post-release-v1.sh - - name: Create Next Snapshot Pull Request - uses: peter-evans/create-pull-request@v8 - if: env.RELEASE_OK == 'yes' - 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 - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SC_VERSION: - SC_NEXT_VERSION: - GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PRIVATE_PASSPHRASE }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 5111513586..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Release - -on: - workflow_dispatch: - branches: ["master"] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - 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 3.10 - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Set up Java 11 - uses: actions/setup-java@v5 - with: - java-version: 11 - distribution: temurin - server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} - - name: Cache local Maven repository - uses: actions/cache@v5 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Run pre release script - id: preRelease - run: | - # export GPG_TTY=$(tty) - export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec` - if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]]; - then - echo "not releasing snapshot version: " ${MY_POM_VERSION} - echo "RELEASE_OK=no" >> $GITHUB_ENV - else - . ./CI/pre-release.sh - echo "RELEASE_OK=yes" >> $GITHUB_ENV - fi - echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV - echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV - echo "SC_LAST_RELEASE=$SC_LAST_RELEASE" >> $GITHUB_ENV - - name: configure git user email - run: | - git config --global user.email "action@github.com" - git config --global user.name "GitHub Action" - git config --global hub.protocol https - git remote set-url origin https://\${{ secrets.GITHUB_TOKEN }}:x-oauth-basic@github.com/swagger-api/swagger-parser.git - - name: Run maven deploy/release - if: env.RELEASE_OK == 'yes' - run: | - mvn --no-transfer-progress -B -Prelease deploy - - name: Run post release script - id: postRelease - if: env.RELEASE_OK == 'yes' - run: | - . ./CI/post-release.sh - - name: Create Next Snapshot Pull Request - uses: peter-evans/create-pull-request@v8 - if: env.RELEASE_OK == 'yes' - 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 - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SC_VERSION: - SC_NEXT_VERSION: - GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PRIVATE_PASSPHRASE }}