Skip to content

Commit

Permalink
Merge pull request #1040 from Ladicek/fix-github-actions
Browse files Browse the repository at this point in the history
fix GitHub Actions setup
  • Loading branch information
Ladicek authored Jul 19, 2024
2 parents bedb871 + 422de7f commit f1dae60
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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}}
112 changes: 60 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit f1dae60

Please sign in to comment.