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 8, 2020
1 parent 20fd678 commit c5a1e75
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 27 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 Config
release:
current-version: 2.1.2-SNAPSHOT
next-version: 2.1.3-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.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: SmallRye Build

on:
push:
branches:
- master
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
Expand Down
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/setup-java@v1.3.0
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 "smallrye@googlegroups.com"
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/jwt
16 changes: 11 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

// Variables
:microprofile-jwt: https://github.com/eclipse/microprofile-jwt-auth/
:mp-jwt-name: Eclipse MicroProfile JWT RBAC
:ci: https://github.com/smallrye/smallrye-config/actions?query=workflow%3A%22SmallRye+Build%22
:sonar: https://sonarcloud.io/dashboard?id=smallrye_smallrye-config

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

= SmallRye JWT

Expand Down Expand Up @@ -79,8 +80,13 @@ mvn clean install
** link:testsuite/tck[] Test suite to run the implementation against the {mp-jwt-name} TCK.
* link:doc[] - Project documentation.

=== Contributing

Please refer to our Wiki for the https://github.com/smallrye/smallrye-parent/wiki[Contribution Guidelines].

=== Links

* http://github.com/smallrye/smallrye-jwt/[Project Homepage]
* {microprofile-jwt}[{mp-jwt-name}]
* https://smallrye.io/docs/smallrye-jwt/index.html[Documentation]

49 changes: 27 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,28 +131,33 @@
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<configuration>
<sourceHighlighter>coderay</sourceHighlighter>
<attributes>
<icons>font</icons>
<pagenums />
<version>${project.version}</version>
<idprefix />
<idseparator>-</idseparator>
<allow-uri-read>true</allow-uri-read>
<revnumber>${project.version}</revnumber>
<revdate>${maven.build.timestamp}</revdate>
<organization>${project.organization.name}</organization>
</attributes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<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 c5a1e75

Please sign in to comment.