-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from retest/feature/github-actions
Build and deploy with GitHub Actions
- Loading branch information
Showing
7 changed files
with
96 additions
and
55 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
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,43 @@ | ||
on: [push, pull_request] | ||
|
||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
|
||
# fetch unshallow to enable blame for Sonar | ||
- name: Fetch unshallow | ||
run: git fetch --prune --unshallow | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
|
||
- name: Cache Maven | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.m2/repository/ | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-maven- | ||
|
||
- name: Cache Sonar | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.sonar/cache/ | ||
key: ${{ runner.os }}-sonar | ||
|
||
- name: Build with Maven | ||
run: > | ||
mvn --batch-mode verify sonar:sonar -Pcoverage | ||
-Dsonar.host.url=https://sonarcloud.io | ||
-Dsonar.organization=retest | ||
-Dsonar.projectKey=de.retest:recheck.cli |
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,51 @@ | ||
on: | ||
push: | ||
tags: v* | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
|
||
- name: Cache Maven | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.m2/repository/ | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-maven- | ||
|
||
- name: Package with Maven | ||
id: maven_package | ||
run: | | ||
mvn --batch-mode package -DskipTests | ||
cd ./target/ | ||
echo "::set-output name=zip_name::$(echo recheck.cli-*-bin.zip)" | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: true | ||
|
||
- name: Upload release asset | ||
id: upload_release_asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./target/${{ steps.maven_package.outputs.zip_name }} | ||
asset_name: ${{ steps.maven_package.outputs.zip_name }} | ||
asset_content_type: application/zip |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.