From 422de7fb6db2c5b1481a03f2f506cbfe249ff209 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Fri, 19 Jul 2024 11:46:16 +0200 Subject: [PATCH] fix GitHub Actions setup --- .github/workflows/build.yml | 2 +- .github/workflows/pre-release.yml | 14 ++-- .github/workflows/release.yml | 112 ++++++++++++++++-------------- 3 files changed, 68 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 582f1d827..cb1341284 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: - name: Build with Maven (Mac) if: ${{ matrix.os == 'macos-latest' }} shell: bash - run: mvn -s .github/maven-ci-settings.xml -B formatter:validate verify --file pom.xml -Dorg.eclipse.microprofile.fault.tolerance.tck.timeout.multiplier=3.0 + run: mvn -s .github/maven-ci-settings.xml -B formatter:validate verify --file pom.xml -Dorg.eclipse.microprofile.fault.tolerance.tck.timeout.multiplier=3.0 -DslowMachine - name: Upload TCK report if: ${{ matrix.java == '11' && matrix.os == 'ubuntu-latest' }} diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 343d47e84..6bd8fbd75 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -1,19 +1,19 @@ -name: SmallRye Pre Release +name: SmallRye Pre-Release on: pull_request: paths: - - '.github/project.yml' + - '.github/project.yml' jobs: release: + name: Pre-release checks runs-on: ubuntu-latest - name: pre release steps: - - uses: radcortez/project-metadata-action@main - name: retrieve project metadata + - name: Retrieve project metadata id: metadata + uses: radcortez/project-metadata-action@main with: github-token: ${{secrets.GITHUB_TOKEN}} metadata-file-path: '.github/project.yml' @@ -24,8 +24,8 @@ jobs: echo '::error::Cannot release a SNAPSHOT version.' exit 1 - - uses: radcortez/milestone-review-action@main - name: milestone review + - name: Milestone review + uses: radcortez/milestone-review-action@main with: github-token: ${{secrets.GITHUB_TOKEN}} milestone-title: ${{steps.metadata.outputs.current-version}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 392cf3636..70f686c00 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,71 +2,79 @@ name: SmallRye Release on: pull_request: - types: [closed] + types: + - closed paths: - - '.github/project.yml' + - '.github/project.yml' jobs: release: + name: Release runs-on: ubuntu-latest - name: release if: ${{github.event.pull_request.merged == true}} env: GITHUB_TOKEN: ${{secrets.RELEASE_TOKEN}} steps: - - uses: radcortez/project-metadata-action@main - name: retrieve project metadata - id: metadata - with: - github-token: ${{secrets.GITHUB_TOKEN}} - metadata-file-path: '.github/project.yml' + - name: Retrieve project metadata + id: metadata + uses: radcortez/project-metadata-action@main + with: + github-token: ${{secrets.GITHUB_TOKEN}} + metadata-file-path: '.github/project.yml' - - uses: actions/checkout@v4 - with: - token: ${{secrets.RELEASE_TOKEN}} + - name: Checkout + uses: actions/checkout@v4 + with: + token: ${{secrets.RELEASE_TOKEN}} - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 11 - server-id: 'oss.sonatype' - server-username: 'MAVEN_DEPLOY_USERNAME' - server-password: 'MAVEN_DEPLOY_TOKEN' - gpg-private-key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}} - gpg-passphrase: 'MAVEN_GPG_PASSPHRASE' + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 11 + server-id: 'oss.sonatype' + server-username: 'MAVEN_DEPLOY_USERNAME' + server-password: 'MAVEN_DEPLOY_TOKEN' + gpg-private-key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}} + gpg-passphrase: 'MAVEN_GPG_PASSPHRASE' - - name: maven release ${{steps.metadata.outputs.current-version}} - run: | - java -version - git config --global user.name "SmallRye CI" - git config --global user.email "smallrye@googlegroups.com" - git checkout -b release - sed -i -e 's|^version: main|version: ${{steps.metadata.outputs.current-version}}|' doc/antora.yml - sed -i -e 's|smallrye-fault-tolerance-version: .*|smallrye-fault-tolerance-version: '"'"'${{steps.metadata.outputs.current-version}}'"'"'|' doc/antora.yml - MP_FT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=version.microprofile-fault-tolerance -q -DforceStdout) - sed -i -e 's|microprofile-fault-tolerance-version: .*|microprofile-fault-tolerance-version: '"'$MP_FT_VERSION'"'|' doc/antora.yml - VERTX_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=version.vertx -q -DforceStdout) - sed -i -e 's|vertx4-version: .*|vertx4-version: '"'$VERTX_VERSION'"'|' doc/antora.yml - git commit -a -m 'Amendments before release' - mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} - git checkout ${{github.base_ref}} - git rebase release - mvn -B release:perform -Prelease - sed -i -e 's|https://smallrye.io/docs/smallrye-fault-tolerance/.*/index.html|https://smallrye.io/docs/smallrye-fault-tolerance/${{steps.metadata.outputs.current-version}}/index.html|' README.adoc - sed -i -e 's|^version: ${{steps.metadata.outputs.current-version}}|version: main|' doc/antora.yml - git commit -a -m 'Amendments after release' - git push - git push --tags + - name: Maven release ${{steps.metadata.outputs.current-version}} + env: + MAVEN_DEPLOY_USERNAME: ${{secrets.MAVEN_DEPLOY_USERNAME}} + MAVEN_DEPLOY_TOKEN: ${{secrets.MAVEN_DEPLOY_TOKEN}} + MAVEN_GPG_PASSPHRASE: ${{secrets.MAVEN_GPG_PASSPHRASE}} + run: | + java -version + git config --global user.name "SmallRye CI" + git config --global user.email "smallrye@googlegroups.com" + git checkout -b release + sed -i -e 's|^version: main|version: ${{steps.metadata.outputs.current-version}}|' doc/antora.yml + sed -i -e 's|smallrye-fault-tolerance-version: .*|smallrye-fault-tolerance-version: '"'"'${{steps.metadata.outputs.current-version}}'"'"'|' doc/antora.yml + MP_FT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=version.microprofile-fault-tolerance -q -DforceStdout) + sed -i -e 's|microprofile-fault-tolerance-version: .*|microprofile-fault-tolerance-version: '"'$MP_FT_VERSION'"'|' doc/antora.yml + VERTX_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=version.vertx -q -DforceStdout) + sed -i -e 's|vertx4-version: .*|vertx4-version: '"'$VERTX_VERSION'"'|' doc/antora.yml + git commit -a -m 'Amendments before release' + mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} + git checkout ${{github.base_ref}} + git rebase release + mvn -B release:perform -Prelease + sed -i -e 's|https://smallrye.io/docs/smallrye-fault-tolerance/.*/index.html|https://smallrye.io/docs/smallrye-fault-tolerance/${{steps.metadata.outputs.current-version}}/index.html|' README.adoc + sed -i -e 's|^version: ${{steps.metadata.outputs.current-version}}|version: main|' doc/antora.yml + git commit -a -m 'Amendments after release' + git push + git push --tags - - uses: actions/upload-artifact@v4 + - name: TCK report + uses: actions/upload-artifact@v4 + with: name: tck-report - with: - name: tck-report - path: testsuite/tck/target/surefire-reports + path: testsuite/tck/target/surefire-reports - - uses: radcortez/milestone-release-action@main - name: milestone release - with: - github-token: ${{secrets.GITHUB_TOKEN}} - milestone-title: ${{steps.metadata.outputs.current-version}} + - name: Milestone release + uses: radcortez/milestone-release-action@main + with: + github-token: ${{secrets.GITHUB_TOKEN}} + milestone-title: ${{steps.metadata.outputs.current-version}} + milestone-next: ${{steps.metadata.outputs.next-version}}