Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create build.yml #1

Merged
merged 2 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test

on:
push:
branches:
- master

jobs:
build:
name: Test build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@master
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 12
uses: actions/setup-java@master
with:
java-version: 12
- name: Build and test project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export MVN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "::set-env name=MVN_PROJECT_VERSION::$MVN_PROJECT_VERSION"
mvn -DskipTests=true --no-transfer-progress clean package
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
branches:
- main

jobs:
build:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@master
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 12
uses: actions/setup-java@master
with:
java-version: 12
- name: Build and test project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export MVN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "::set-env name=MVN_PROJECT_VERSION::$MVN_PROJECT_VERSION"
mvn -DskipTests=true --no-transfer-progress clean package

- name: Create Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.MVN_PROJECT_VERSION }}
release_name: Release v${{ env.MVN_PROJECT_VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/hanaconnector.war
asset_name: hanaconnector.war
asset_content_type: application/war