diff --git a/.editorconfig b/.editorconfig index 315b30a..cd2670c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,3 +6,6 @@ indent_size = 4 indent_style = space insert_final_newline = true max_line_length = off + +[*.yml] +indent_size = 2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94047f8..6c4fd65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,27 +1,46 @@ name: Build on: - push: - branches: [ "**" ] - tags-ignore: [ "**" ] - pull_request: + push: + branches: [ "**" ] + tags-ignore: [ "**" ] + pull_request: jobs: - build: - # Only run on PRs if the source branch is on someone else's repo - if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} - runs-on: ubuntu-latest - strategy: - matrix: - java: [ 17 ] - fail-fast: true - steps: - - uses: actions/checkout@v4 - - uses: gradle/wrapper-validation-action@v2 - - name: JDK ${{ matrix.java }} - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java }} - distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v3 - - name: Build - run: ./gradlew build --stacktrace + build: + # Only run on PRs if the source branch is on someone else's repo + if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17 ] + fail-fast: true + steps: + - uses: actions/checkout@v4 + - uses: gradle/wrapper-validation-action@v2 + - name: JDK ${{ matrix.java }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + - uses: gradle/actions/setup-gradle@v3 + - name: Build + run: ./gradlew build --stacktrace + - name: Determine Status + run: | + if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then + echo "STATUS=snapshot" >> $GITHUB_ENV + else + echo "STATUS=release" >> $GITHUB_ENV + fi + - name: Publish Snapshot + if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}" + run: ./gradlew publish + env: + ORG_GRADLE_PROJECT_paperUsername: "${{ secrets.PAPER_REPO_USER }}" + ORG_GRADLE_PROJECT_paperPassword: "${{ secrets.PAPER_REPO_PASSWORD }}" + - name: Publish Release + if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}" + run: ./gradlew publish + env: + ORG_GRADLE_PROJECT_paperUsername: "${{ secrets.PAPER_REPO_USER }}" + ORG_GRADLE_PROJECT_paperPassword: "${{ secrets.PAPER_REPO_PASSWORD }}" diff --git a/build.gradle.kts b/build.gradle.kts index f9f4fa4..4f6c7c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,11 @@ +import org.incendo.cloudbuildlogic.jmp + plugins { val indraVer = "3.1.3" id("net.kyori.indra") version indraVer id("net.kyori.indra.checkstyle") version indraVer id("net.kyori.indra.publishing") version indraVer + id("org.incendo.cloud-build-logic.javadoc-links") version "0.0.12" } allprojects { @@ -14,6 +17,33 @@ allprojects { javaVersions { target(17) } + + publishSnapshotsTo("paperSnapshots", "https://repo.papermc.io/repository/maven-snapshots/") + publishReleasesTo("paperReleases", "https://repo.papermc.io/repository/maven-releases/") + + apache2License() + + github("PaperMC", "asm-utils") { + ci(true) + } + + configurePublications { + pom { + developers { + jmp() + developer { + id = "Machine-Maker" + name = "Jake Potrebic" + url = "https://github.com/Machine-Maker" + } + developer { + id = "kennytv" + name = "Nassim Jahnke" + url = "https://github.com/kennytv" + } + } + } + } } repositories { diff --git a/gradle.properties b/gradle.properties index a67330c..cbf89f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,7 @@ # project meta group=io.papermc version=0.0.1-SNAPSHOT +description=Shared ASM utilities for PaperMC projects # gradle options org.gradle.caching=true