Set up CI
This commit is contained in:
parent
1ce73b3554
commit
b0ea3ad8a4
22
.github/workflows/gradle.yml
vendored
Normal file
22
.github/workflows/gradle.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
name: Java CI with Gradle
|
||||
on:
|
||||
[push, pull_request]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
- name: Build with Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: build
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: github.event_name != 'pull_request'
|
||||
with:
|
||||
name: Package
|
||||
path: build/libs
|
24
.github/workflows/publish.yml
vendored
Normal file
24
.github/workflows/publish.yml
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
name: Publish tag
|
||||
on:
|
||||
push
|
||||
jobs:
|
||||
build:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TAG_NAME: ${{ github.ref_name }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
- name: Build with Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: build
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: build/libs/*
|
|
@ -21,6 +21,11 @@ version = '0.5.0-dev.5'
|
|||
group = 'at.petra-k.hexcasting' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'hexcasting'
|
||||
|
||||
if (System.getenv('TAG_NAME') != null) {
|
||||
version = System.getenv('TAG_NAME').substring(1)
|
||||
println 'Version overridden to tag version ' + version
|
||||
}
|
||||
|
||||
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
|
||||
|
|
Loading…
Reference in a new issue