Skip to content

Commit

Permalink
Setup CI and Release Pipelines.
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez committed May 20, 2020
1 parent 61a7219 commit fc2918f
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: SmallRye Fault Tolerance
release:
current-version: 4.2.1-SNAPSHOT
next-version: 4.2.2-SNAPSHOT
Binary file added .github/release/maven-settings.xml.gpg
Binary file not shown.
Binary file added .github/release/smallrye-sign.asc.gpg
Binary file not shown.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: SmallRye Build

on:
push:
branches:
- master
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- 'NOTICE'
- 'README*'
pull_request:
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- 'NOTICE'
- 'README*'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
name: build with jdk ${{matrix.java}}

steps:
- uses: actions/checkout@v2
name: checkout

- uses: actions/[email protected]
name: set up jdk ${{matrix.java}}
with:
java-version: ${{matrix.java}}

- name: build with maven
run: mvn -B formatter:validate verify --file pom.xml

quality:
needs: [build]
if: github.event_name == 'push' && startsWith('smallrye', github.repository)
runs-on: ubuntu-latest
name: quality

steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
java-version: 8

- name: sonar
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
run: mvn -B verify --file pom.xml -Pcoverage javadoc:javadoc sonar:sonar -Dsonar.projectKey=smallrye_smallrye-fault-tolerance -Dsonar.login=$SONAR_TOKEN
31 changes: 31 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: SmallRye Pre Release

on:
pull_request:
paths:
- '.github/project.yml'

jobs:
release:
runs-on: ubuntu-latest
name: pre release

steps:
- uses: radcortez/project-metadata-action@master
name: retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'

- name: Validate version
if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
run: |
echo '::error::Cannot release a SNAPSHOT version.'
exit 1
- uses: radcortez/milestone-review-action@master
name: milestone review
with:
github-token: ${{secrets.GITHUB_TOKEN}}
milestone-title: ${{steps.metadata.outputs.current-version}}
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: SmallRye Release

on:
pull_request:
types: [closed]
paths:
- '.github/project.yml'

jobs:
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@master
name: retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'

- uses: actions/checkout@v2
with:
token: ${{secrets.RELEASE_TOKEN}}

- uses: actions/[email protected]
with:
java-version: 8

- name: maven release ${{steps.metadata.outputs.current-version}}
run: |
java -version
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" --output smallrye-sign.asc .github/release/smallrye-sign.asc.gpg
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg
gpg --fast-import --no-tty --batch --yes smallrye-sign.asc
git config --global user.name "SmallRye CI"
git config --global user.email "[email protected]"
git checkout -b release
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -s maven-settings.xml
git checkout ${{github.base_ref}}
git rebase release
mvn -B release:perform -Prelease -s maven-settings.xml
git push
git push --tags
- uses: radcortez/milestone-release-action@master
name: milestone release
with:
github-token: ${{secrets.GITHUB_TOKEN}}
milestone-title: ${{steps.metadata.outputs.current-version}}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github @smallrye/fault-tolerance
9 changes: 6 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
:microprofile-fault-tolerance: https://github.com/eclipse/microprofile-fault-tolerance/
:ci: https://github.com/smallrye/smallrye-fault-tolerance/actions?query=workflow%3A%22SmallRye+Build%22
:sonar: https://sonarcloud.io/dashboard?id=smallrye_smallrye-fault-tolerance

image:https://semaphoreci.com/api/v1/smallrye/smallrye-fault-tolerance/branches/master/badge.svg["Semaphore CI", link="https://semaphoreci.com/smallrye/smallrye-fault-tolerance"]
image:https://sonarcloud.io/api/project_badges/measure?project=smallrye_smallrye-fault-tolerance&metric=alert_status["Quality Gate Status", link="https://sonarcloud.io/dashboard?id=smallrye_smallrye-fault-tolerance"]
image:https://img.shields.io/github/license/thorntail/thorntail.svg["License", link="http://www.apache.org/licenses/LICENSE-2.0"]
image:https://github.com/smallrye/smallrye-fault-tolerance/workflows/SmallRye%20Build/badge.svg?branch=master[link={ci}]
image:https://sonarcloud.io/api/project_badges/measure?project=smallrye_smallrye-fault-tolerance&metric=alert_status["Quality Gate Status", link={sonar}]
image:https://img.shields.io/github/license/smallrye/smallrye-fault-tolerance.svg["License", link="http://www.apache.org/licenses/LICENSE-2.0"]
image:https://img.shields.io/maven-central/v/io.smallrye/smallrye-fault-tolerance?color=green[]

== SmallRye Fault Tolerance

Expand Down
28 changes: 28 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,34 @@
</plugin>
</plugins>
</pluginManagement>
<!-- TODO - to remve once these changes are in the Parent POM -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${version.release.plugin}</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>@{project.version}</tagNameFormat>
<preparationGoals>verify</preparationGoals>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
<remoteTagging>false</remoteTagging>
<arguments>-DskipTests ${release.arguments}</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${version.gpg.plugin}</version>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
Expand Down

0 comments on commit fc2918f

Please sign in to comment.