-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (54 loc) · 1.92 KB
/
gradle_release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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/[email protected]
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