diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-07-15 17:05:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 17:05:03 +0200 |
commit | 9293e2833b01dcb76af85fcb2388a33701dc3ca1 (patch) | |
tree | 712c3172fd9b156a244fa948542dd997e7d083b1 | |
parent | afc7e5877903ce925a873c5c9079a69180ce510e (diff) | |
download | OneConfig-9293e2833b01dcb76af85fcb2388a33701dc3ca1.tar.gz OneConfig-9293e2833b01dcb76af85fcb2388a33701dc3ca1.tar.bz2 OneConfig-9293e2833b01dcb76af85fcb2388a33701dc3ca1.zip |
Release workflow (#53)
* release workflow
* update normal version to hash
* fix
* fix naming
* fix some stuff
* fix version thing
* switch to number from hash
-rw-r--r-- | .github/workflows/build.yml | 45 | ||||
-rw-r--r-- | .github/workflows/checks.yml | 43 | ||||
-rw-r--r-- | .github/workflows/release.yml | 48 | ||||
-rw-r--r-- | build.gradle.kts | 7 | ||||
-rw-r--r-- | gradle.properties | 3 | ||||
-rw-r--r-- | versions/build.gradle.kts | 17 |
6 files changed, 108 insertions, 55 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..62816b1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +# Build Workflow + +name: Build + +on: + pull_request: + workflow_dispatch: + push: + branches-ignore: + - master + +concurrency: + group: ${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }} + cancel-in-progress: true + +jobs: + build: + name: Build + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: temurin + cache: gradle + + - name: Chmod Gradle + run: chmod +x ./gradlew + + - name: Build + run: ./gradlew build --no-daemon + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v2 + with: + name: oneconfig-artifacts + path: versions/**/build/libs/ diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 1172731..0000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Build Workflow - -name: Build - -on: - - pull_request - - workflow_dispatch - - push - -concurrency: - group: ${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }} - cancel-in-progress: true - -jobs: - build: - name: Build - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: 17 - distribution: temurin - cache: gradle - - - name: Chmod Gradle - run: chmod +x ./gradlew - - - name: Build - run: ./gradlew build --no-daemon - - - name: Upload Build Artifacts - uses: actions/upload-artifact@v2 - with: - name: oneconfig-artifacts - path: versions/**/build/libs/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9d75d9c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +# Release Workflow + +name: Release + +on: + workflow_dispatch: + push: + branches: + - master + +concurrency: + group: ${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }} + cancel-in-progress: true + +jobs: + build: + name: Build + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: temurin + cache: gradle + + - name: Chmod Gradle + run: chmod +x ./gradlew + + - name: Get version number + run: echo '::set-output name=VERSION_NUMBER::$(46 + ${{ github.run_number }})' + id: version + + - name: Publish + run: ./gradlew platform:1.8.9-forge:publishOneconfig-1.8.9-forgePublicationToReleasesRepository -Pmod_minor_version=${{ steps.version.outputs.VERSION_NUMBER }} -PreleasesUsername=${{ secrets.MAVEN_NAME }} -PreleasesPassword=${{ secrets.MAVEN_TOKEN }} --no-daemon + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v2 + with: + name: oneconfig-artifacts + path: versions/**/build/libs/
\ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index dd28e33..056d1d1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,16 +23,17 @@ java { } val mod_name: String by project -val mod_version: String by project +val mod_major_version: String by project +val mod_minor_version: String by project val mod_id: String by project blossom { - replaceToken("@VER@", mod_version) + replaceToken("@VER@", mod_major_version + mod_minor_version) replaceToken("@NAME@", mod_name) replaceToken("@ID@", mod_id) } -version = mod_version +version = mod_major_version + mod_minor_version group = "cc.polyfrost" repositories { diff --git a/gradle.properties b/gradle.properties index 3bedb89..f5773f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,7 @@ mod_name = OneConfig mod_id = oneconfig -mod_version = 0.1.0-alpha50 +mod_major_version = 0.1.0-alpha +mod_minor_version = -LOCAL essential.defaults.loom=0 diff --git a/versions/build.gradle.kts b/versions/build.gradle.kts index 9c41c62..e8c161d 100644 --- a/versions/build.gradle.kts +++ b/versions/build.gradle.kts @@ -28,7 +28,8 @@ java { } val mod_name: String by project -val mod_version: String by project +val mod_major_version: String by project +val mod_minor_version: String by project val mod_id: String by project preprocess { @@ -36,12 +37,12 @@ preprocess { } blossom { - replaceToken("@VER@", mod_version) + replaceToken("@VER@", mod_major_version + mod_minor_version) replaceToken("@NAME@", mod_name) replaceToken("@ID@", mod_id) } -version = mod_version +version = mod_major_version + mod_minor_version group = "cc.polyfrost" base { archivesName.set("$mod_id-$platform") @@ -181,7 +182,7 @@ tasks { val compatLevel = "JAVA_${java}" inputs.property("java", java) inputs.property("java_level", compatLevel) - inputs.property("version", mod_version) + inputs.property("version", mod_major_version + mod_minor_version) inputs.property("mcVersionStr", project.platform.mcVersionStr) filesMatching(listOf("mcmod.info", "mixins.${mod_id}.json", "**/mods.toml")) { expand( @@ -190,7 +191,7 @@ tasks { "name" to mod_name, "java" to java, "java_level" to compatLevel, - "version" to mod_version, + "version" to mod_major_version + mod_minor_version, "mcVersionStr" to project.platform.mcVersionStr ) ) @@ -202,7 +203,7 @@ tasks { "name" to mod_name, "java" to java, "java_level" to compatLevel, - "version" to mod_version, + "version" to mod_major_version + mod_minor_version, "mcVersionStr" to project.platform.mcVersionStr.substringBeforeLast(".") + ".x" ) ) @@ -268,7 +269,7 @@ tasks { "Specification-Vendor" to mod_id, "Specification-Version" to "1", // We are version 1 of ourselves, whatever the hell that means "Implementation-Title" to mod_name, - "Implementation-Version" to mod_version, + "Implementation-Version" to mod_major_version + mod_minor_version, "Implementation-Vendor" to mod_id, "Implementation-Timestamp" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(`java.util`.Date()) ) @@ -287,7 +288,7 @@ tasks { dokkaHtml.configure { outputDirectory.set(buildDir.resolve("dokka")) moduleName.set("OneConfig $platform") - moduleVersion.set(mod_version) + moduleVersion.set(mod_major_version + mod_minor_version) dokkaSourceSets { configureEach { jdkVersion.set(8) |