diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a461e4da..40ea85f2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -5,19 +5,39 @@ name: Build SongodaCore on: push: - branches: [ master ] + branches: [ master, development ] pull_request: types: [ opened, synchronize, reopened ] jobs: build: + name: Build runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 16 - uses: actions/setup-java@v1 + # Setup Java + - uses: actions/setup-java@v2 with: java-version: 16 + distribution: adopt + + # Checkout project files + - uses: actions/checkout@v2 + + # Caches + - name: 'Cache: Maven' + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + + # Build project - name: Build with Maven - run: mvn -B package --file pom.xml + run: 'mvn -B -Duser.name="GitHub Runner on $GITHUB_REPOSITORY (id=$GITHUB_RUN_ID)" clean package' + + # Upload build artifacts + - name: 'Upload Build Artifact: SongodaCore-*.jar' + uses: actions/upload-artifact@v2 + with: + name: EpicAnchors-artifacts + path: ./Core/target/SongodaCore-*.jar