Skip to content

Commit

Permalink
Build: Enable GitHub Actions based CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Johni0702 committed Sep 11, 2023
1 parent 7d0c9f4 commit 6233535
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build & Publish

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: |
8
16
17
cache: gradle

- name: Setup environment
run: |
echo "ORG_GRADLE_PROJECT_BUILD_ID=$(expr ${{ github.run_number }} + 290)" >> "$GITHUB_ENV"
# GitHub runners are limited to 7GB of RAM, so we'll limit our Gradle Daemon process to about half of that
# which is enough so long as parallel task execution is limited.
# We also pin the amount of workers, so it doesn't break should GitHub increase the default available vCPUs.
# We write these to GRADLE_USER_HOME to overrule the local "gradle.properties" of the project.
mkdir -p "${GRADLE_USER_HOME:=~/.gradle}"
echo "org.gradle.jvmargs=-Xmx4G" >> "$GRADLE_USER_HOME/gradle.properties"
echo "org.gradle.workers.max=2" >> "$GRADLE_USER_HOME/gradle.properties"
- name: Build
run: ./gradlew clean --stacktrace

- name: Publish
run: echo ./gradlew publish --stacktrace
if: env.NEXUS_USER != null
env:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ org.gradle.parallel=true
org.gradle.configureoncommand=true
org.gradle.parallel.threads=4
org.gradle.jvmargs=-Xmx8G
# cache buster comment

0 comments on commit 6233535

Please sign in to comment.