diff --git a/.github/workflows/publish_beta.yml b/.github/workflows/publish_beta.yml new file mode 100644 index 0000000..e7e6fcf --- /dev/null +++ b/.github/workflows/publish_beta.yml @@ -0,0 +1,46 @@ + +name: Automated beta builds + +on: + push: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + + - name: Run datagen + run: ./gradlew runDatagen + + - name: Build + run: ./gradlew build + #env: + # BETA: 1 # exclude assets if it's a beta dev build + + - name: Publish artifacts + uses: DrTheodor/discord-webhook-upload-action@v1.2 + with: + url: ${{ secrets.DEV_BUILDS }} + file: 'build/libs/*' + username: tony stank + avatar: 'https://img.asmedia.epimg.net/resizer/v2/5R475RB4FZAOJIDICEZLRYLDZM.jpg?auth=e8fe4ea252b5bf7424148eb36e30055f04fc07cd4b2cb88e8f94bee7b8346ac0&width=1472&height=1104&smart=true' + commit: '> :sparkles: [%MESSAGE%](<%LINK%>) by [%AUTHOR%](<%AUTHOR_LINK%>)' + message: | + <:new1:1253371736510959636><:new2:1253371805734015006> New `${{ github.repository }}` dev build `#${{ github.run_number }}`: + %COMMITS% \ No newline at end of file diff --git a/build.gradle b/build.gradle index f01e574..6b2525e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,10 @@ plugins { id 'maven-publish' } -version = project.mod_version -group = project.maven_group +apply from: 'versioning.gradle' +version = getCurrentVersion() +group = project.maven_group base { archivesName = project.archives_base_name } @@ -65,7 +66,7 @@ java { // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this line, sources will not be generated. - withSourcesJar() + // withSourcesJar() sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 diff --git a/gradle.properties b/gradle.properties index c893926..8faeb41 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,6 +10,7 @@ loader_version=0.15.6 # Mod Properties mod_version=1.0.0 +mod_version_qualifier = alpha maven_group=mc.duzo.timeless archives_base_name=timeless diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/versioning.gradle b/versioning.gradle new file mode 100644 index 0000000..265fb8b --- /dev/null +++ b/versioning.gradle @@ -0,0 +1,6 @@ +ext.getCurrentVersion = { + var patch = System.getenv("GITHUB_RUN_NUMBER") + + return project.mod_version + (patch != null ? ("." + System.getenv("GITHUB_RUN_NUMBER")) : "")\ + + "-" + project.minecraft_version + "-" + project.mod_version_qualifier +} \ No newline at end of file