-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): Migration from Travis to GitHub action
- Loading branch information
Showing
5 changed files
with
186 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: 'Java Build' | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
env: | ||
MAVEN_ARGS: -B -ntp -Prelease -Pcoverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build Maven | ||
run: mvn ${MAVEN_ARGS} compile | ||
- name: Maven Test | ||
run: mvn ${MAVEN_ARGS} test | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Code quality | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: mvn ${MAVEN_ARGS} -Dsonar.branch.name=${CIRCLE_BRANCH} -Dsonar.java.binaries=target/classes -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=yyvess-github -Dmaven.javadoc.skip=true jacoco:report sonar:sonar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
name: Release | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Java Build"] | ||
branches: ["master"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
env: | ||
MAVEN_ARGS: -B -ntp -Prelease -Dmaven.test.skip=true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Maven Central Repository | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
server-id: sonatype-nexus-releases | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
- name: Configure GPG Key | ||
env: | ||
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
run: | | ||
mkdir -p ~/.gnupg/ | ||
printf "$GPG_SIGNING_KEY" | base64 --decode > ~/.gnupg/private.key | ||
gpg --import ~/.gnupg/private.key | ||
- uses: actions/checkout@v2 | ||
- name: Bump the version | ||
id: bump_version | ||
uses: mathieudutour/github-tag-action@v5 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
dry_run: true | ||
custom_release_rules: patch:patch,minor:minor,major:major | ||
release_branches: release.*,hotfix.*,master | ||
- name: Build the release | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.NEXUS_USER }} | ||
MAVEN_PASSWORD: ${{ secrets.NEXUS_PWD }} | ||
run: mvn ${MAVEN_ARGS} -Drevision=${{ steps.bump_version.outputs.new_tag }} -Dchangelist= install | ||
- name: Tag the version | ||
id: tag_version | ||
uses: mathieudutour/github-tag-action@v5 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_release_rules: patch:patch,minor:minor,major:major | ||
release_branches: release.*,hotfix.*,master | ||
- name: Deploy the release to maven central | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.NEXUS_USER }} | ||
MAVEN_PASSWORD: ${{ secrets.NEXUS_PWD }} | ||
run: mvn ${MAVEN_ARGS} -Drevision=${{ steps.bump_version.outputs.new_tag }} -Dchangelist= deploy | ||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.bump_version.outputs.new_tag }} | ||
release_name: Release ${{ steps.bump_version.outputs.new_tag }} | ||
body: | | ||
Automatically released due to commit on ${{ github.ref }} | ||
${{ steps.bump_version.outputs.changelog }} | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
/.classpath | ||
/.project | ||
/target | ||
jsconf.iml | ||
jsconf.iml | ||
.flattened-pom.xml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters