Skip to content

Commit

Permalink
v6.17.2
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHeijden committed Jan 12, 2024
1 parent 86413db commit 56e23a9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 9 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
pull_request:
branches: [ master ]
jobs:
build:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17 ]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
Expand All @@ -23,18 +23,38 @@ jobs:
- uses: actions/cache@v3
with:
path: '**/.gradle'
key: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/VersionConstants.kt', '**/build.gradle.kts', '**/gradle-wrapper.properties') }}
key: ${{ runner.os }}-gradle-${{ vars.CACHE_VERSION }}-${{ hashFiles('**/VersionConstants.kt', '**/build.gradle.kts', '**/gradle-wrapper.properties') }}
- name: Build
run: ./gradlew clean build --stacktrace
- name: Upload artififacts
uses: actions/upload-artifact@v3
id: build
run: |
./gradlew clean build --stacktrace
echo "is-release=$(./gradlew -q printIsRelease)" >> "$GITHUB_OUTPUT"
echo "version=$(./gradlew -q printVersion)" >> "$GITHUB_OUTPUT"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Insights
path: jars/*.jar
retention-days: 90
- name: Publish
- name: Publish to Maven Repository
if: ${{ github.event_name == 'push' }}
env:
FVDH_USERNAME: ${{ secrets.FVDH_USERNAME }}
FVDH_TOKEN: ${{ secrets.FVDH_TOKEN }}
run: ./gradlew publish --stacktrace
- uses: Kir-Antipov/[email protected]
if: ${{ github.event_name == 'push' && steps.build.outputs.is-release == 'true' }}
with:
name: ${{ format('Insights {0}', steps.build.outputs.version) }}
version: ${{ steps.build.outputs.version }}
modrinth-id: V27CDDh1
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
files: |
jars/*.jar
loaders: |
paper
purpur
game-versions: |
>=1.19.4 <=1.20.4
game-version-filter: releases
java: 17
18 changes: 17 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
val name = "Insights"
group = "dev.frankheijden.insights"
val dependencyDir = "$group.dependencies"
version = "6.17.1"
version = "6.17.2"

subprojects {
apply(plugin = "java")
Expand Down Expand Up @@ -167,6 +167,22 @@ val artifact: PublishArtifact = artifacts.add("archives", artifactFile) {
builtBy("shadowJar")
}

fun Project.isRelease(): Boolean {
return version.toString().toVersion().preRelease == null
}

task("printIsRelease") {
doLast {
println(isRelease())
}
}

task("printVersion") {
doLast {
println(version.toString())
}
}

publishing {
repositories {
maven {
Expand Down

0 comments on commit 56e23a9

Please sign in to comment.