Merge pull request #588 from UQcsse3200/feature/obstacle-minigame #223
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
# Sequence of patterns matched against refs/heads | |
branches: | |
# Push events on main branch | |
- main | |
jobs: | |
build_game: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 # Checkout repo to remote machine | |
- name: Set up OpenJDK17 # Need to change to JDK17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '17' | |
# SonarCloud Integration | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Gradle packages | |
uses: actions/cache@v1 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Build and Analyse Game | |
run: | | |
cd $GRADLE_DIR | |
chmod +x ./gradlew | |
./gradlew --stacktrace build sonarqube --info | |
ls -al | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
GRADLE_DIR: 'source' # Modify this to wherever './gradlew' is | |
- name: Automatic Release # note the path for the files on this one | |
uses: marvinpinto/action-automatic-releases@v1.2.1 | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: false | |
title: "Latest Build of Game" | |
files: | | |
./source/desktop/build/libs/*.jar | |
# - name: Analyse | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
# GRADLE_DIR: 'source' # Modify this to wherever './gradlew' is | |
# run: ./gradlew sonarqube --info |