diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 079b1dd..36cf2d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,22 +6,27 @@ jobs: build: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - name: Setup Java + run: | + echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV" + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: fregante/setup-git-user@v2 - - uses: actions/setup-java@v3 - with: - distribution: "temurin" - java-version: 17 - - uses: gradle/gradle-build-action@v2 - with: - arguments: build - cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/1.') }} - uses: gradle/gradle-build-action@v2 + name: Setup Gradle with: - arguments: publishPlugins cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/1.') }} + - name: Tag Release + run: ./gradlew tagRelease --configuration-cache + - name: Build + run: ./gradlew build --configuration-cache + - name: Publish + run: ./gradlew publishPlugins --configuration-cache env: - GRADLE_PLUGIN_KEY: ${{ secrets.GRADLE_PLUGIN_KEY }} - GRADLE_PLUGIN_SECRET: ${{ secrets.GRADLE_PLUGIN_SECRET }} + GRADLE_PLUGIN_KEY: ${{ secrets.GRADLE_PLUGIN_KEY }} + GRADLE_PLUGIN_SECRET: ${{ secrets.GRADLE_PLUGIN_SECRET }} + - name: Push Changes + run: | + git push + git push --tags diff --git a/build.gradle b/build.gradle index 1219c75..f169ae1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ plugins { id 'java-gradle-plugin' id 'com.gradle.plugin-publish' version '1.2.1' + id 'dev.lukebemish.managedversioning' version '1.0.0' } group = 'dev.lukebemish.docpatcher' -version = '0.3.4' java { // I don't feel like dealing with old java... @@ -14,15 +14,17 @@ java { repositories { mavenCentral() - maven { - name = "NeoForged" - url = "https://maven.neoforged.net/releases/" - } } +managedVersioning { + versionFile.set rootProject.file('version.properties') +} + +managedVersioning.apply() + dependencies { compileOnly 'org.jetbrains:annotations:24.0.1' - implementation 'net.neoforged.javadoctor:injector-spoon:2.0.5' + implementation 'net.neoforged.javadoctor:injector-spoon:2.0.10' implementation 'fr.inria.gforge.spoon:spoon-core:10.4.1' implementation 'com.google.guava:guava:32.1.2-jre' implementation 'org.apache.commons:commons-text:1.10.0' diff --git a/settings.gradle b/settings.gradle index 1473043..7096470 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,14 @@ +pluginManagement { + repositories { + maven { + name = "Luke's Maven" + url = 'https://maven.lukebemish.dev/releases/' + content { + includeGroupAndSubgroups 'dev.lukebemish' + } + } + gradlePluginPortal() + } +} + rootProject.name = 'docpatcher' diff --git a/test/settings.gradle b/test/settings.gradle index 57b2533..6648ba1 100644 --- a/test/settings.gradle +++ b/test/settings.gradle @@ -1,11 +1,5 @@ pluginManagement { includeBuild('../') - repositories { - maven { - name = "NeoForged" - url = "https://maven.neoforged.net/releases/" - } - } } rootProject.name = 'DocPatcherTest' diff --git a/version.properties b/version.properties new file mode 100644 index 0000000..6e06493 --- /dev/null +++ b/version.properties @@ -0,0 +1 @@ +version=0.3.4