Skip to content

Commit

Permalink
Added Github Actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Churro committed Apr 27, 2021
1 parent 61a2ce5 commit 41a74f0
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CryptoSlice

on: [push, workflow_dispatch]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify

- name: Install ZIP action
uses: montudor/action-zip@v1

- name: Create empty apps directory
run: mkdir -p target/apps

- name: Bundle JAR output with directories in ZIP file
run: zip -r CryptoSlice.zip CryptoSlice-1.0-SNAPSHOT-jar-with-dependencies.jar apps conf
working-directory: target

- name: Store build artifacts
uses: actions/upload-artifact@v2
with:
name: CryptoSlice
path: target/CryptoSlice.zip
if-no-files-found: error

release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Retrieve build artifacts
uses: actions/download-artifact@v2
with:
name: CryptoSlice

- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: CryptoSlice
files: CryptoSlice.zip

0 comments on commit 41a74f0

Please sign in to comment.