Skip to content

Commit

Permalink
chore: migrate builds to github actions
Browse files Browse the repository at this point in the history
Setup GitHub action to compile assets on push.

Note that builds now append GitHub SHA as version meta instead of build number
  • Loading branch information
Indemnity83 authored Nov 18, 2019
1 parent 55dc8ec commit 61ef3b6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Java CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
- name: Publish Artifacts
uses: actions/upload-artifact@master
with:
name: libs
path: build/libs

8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ minecraft {
mappings = config.mappings
runDir = "run"

// Try appending the build number first
if (System.getenv("BUILD_NUMBER") != null) {
project.version += ".${System.getenv("BUILD_NUMBER")}"
// Try appending the github sha first
if (System.getenv("GITHUB_SHA") != null) {
project.version += "+${System.getenv("GITHUB_SHA").substring(0,7)}"

// If that doesn't work, just append "SNAPSHOT"
} else {
project.version += "-SNAPSHOT"
project.version += "+SNAPSHOT"
}

// replacing stuff in the source
Expand Down

0 comments on commit 61ef3b6

Please sign in to comment.