adding gh action maven build
This commit is contained in:
@@ -0,0 +1,77 @@
|
|||||||
|
name: Maven Project Build
|
||||||
|
|
||||||
|
on: [workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '2'
|
||||||
|
steps:
|
||||||
|
- name: Clone repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: uniCenta/unicenta-opos
|
||||||
|
token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
- name: check for files
|
||||||
|
run: ls -ltr
|
||||||
|
|
||||||
|
- name: Check uniCenta maven repo
|
||||||
|
run: curl https://repo.unicenta.org/maven2
|
||||||
|
|
||||||
|
- name: Check IP address
|
||||||
|
run: curl ipinfo.io/ip
|
||||||
|
|
||||||
|
- name: Cache Maven packages
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.m2
|
||||||
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
${{ runner.os }}-m2-
|
||||||
|
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: '11'
|
||||||
|
distribution: 'adopt'
|
||||||
|
architecture: x64
|
||||||
|
cache: maven
|
||||||
|
|
||||||
|
- name: Build with Maven
|
||||||
|
run: mvn clean package
|
||||||
|
|
||||||
|
- name: check for jar
|
||||||
|
run: ls -ltr ./target/
|
||||||
|
|
||||||
|
- name: Set version of application
|
||||||
|
run: echo "APP_VERSION=$(unzip -q -c target/unicentaopos.jar META-INF/MANIFEST.MF | grep -oP '(?<=Implementation-Version:\s)[0-9_.-]*')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: upload build
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: build
|
||||||
|
path: target
|
||||||
|
|
||||||
|
- name: Build linx deb 64
|
||||||
|
uses: benc-uk/workflow-dispatch@v1.1
|
||||||
|
with:
|
||||||
|
workflow: Linux deb 64bit build
|
||||||
|
token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
|
inputs: '{ "version": "${{ env.APP_VERSION }}"}'
|
||||||
|
|
||||||
|
- name: Build Windows 64
|
||||||
|
uses: benc-uk/workflow-dispatch@v1.1
|
||||||
|
with:
|
||||||
|
workflow: Windows 64bit build
|
||||||
|
token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
|
inputs: '{ "version": "${{ env.APP_VERSION }}"}'
|
||||||
|
|
||||||
|
- name: Build MacOS Intel
|
||||||
|
uses: benc-uk/workflow-dispatch@v1.1
|
||||||
|
with:
|
||||||
|
workflow: MACOS Intel build
|
||||||
|
token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
|
inputs: '{ "version": "${{ env.APP_VERSION }}"}'
|
||||||
Reference in New Issue
Block a user