Skip to content

Commit

Permalink
Merge pull request #1 from rtdi/wernerdaehn-patch-1
Browse files Browse the repository at this point in the history
add github actions
  • Loading branch information
wernerdaehn authored Oct 26, 2020
2 parents 734e0ff + 53ea1bc commit c031d84
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
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

0 comments on commit c031d84

Please sign in to comment.