diff --git a/.github/workflows/buildscript-maintenance.yml b/.github/workflows/buildscript-maintenance.yml new file mode 100644 index 0000000..5d9a417 --- /dev/null +++ b/.github/workflows/buildscript-maintenance.yml @@ -0,0 +1,26 @@ +# This workflow only meant for the source mod you shouldn't bring it into your own project + +name: Buildscript maintenance + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + +jobs: + buildscript-maintenance: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: setup git config + run: | + git config user.name "GitHub CI Bot" + git config user.email "<>" + + - name: Ensure build script version is up to date + run: .github/scripts/update-version.sh diff --git a/.github/workflows/repository-specific.yml b/.github/workflows/package-release.yml similarity index 75% rename from .github/workflows/repository-specific.yml rename to .github/workflows/package-release.yml index 5a9dedc..b036a04 100644 --- a/.github/workflows/repository-specific.yml +++ b/.github/workflows/package-release.yml @@ -1,30 +1,12 @@ # This workflow only meant for the source mod you shouldn't bring it into your own project -name: Repository specific CI +name: Release packages on: push: branches: [ master, main ] - pull_request: - branches: [ master, main ] jobs: - buildscript-maintenance: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - - name: setup git config - run: | - git config user.name "GitHub CI Bot" - git config user.email "<>" - - - name: Ensure build script version is up to date - run: .github/scripts/update-version.sh - zip-packages: runs-on: ubuntu-latest steps: @@ -40,7 +22,8 @@ jobs: -x "*.git/*" \ \ -x ".github/scripts/update-version.sh" \ - -x ".github/workflows/repository-specific.yml" \ + -x ".github/workflows/buildscript-maintenance.yml" \ + -x ".github/workflows/package-release.yml" \ \ -x "*docs/*" \ -x "LICENSE" \ @@ -67,7 +50,8 @@ jobs: -x "*.git/*" \ \ -x ".github/scripts/update-version.sh" \ - -x ".github/workflows/repository-specific.yml" \ + -x ".github/workflows/buildscript-maintenance.yml" \ + -x ".github/workflows/package-release.yml" \ \ -x "*docs/*" \ -x "*src/*" \ @@ -76,7 +60,7 @@ jobs: \ -x "starter.zip" \ -x "migration.zip" - + - name: Publish migration package uses: "marvinpinto/action-automatic-releases@latest" with: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..f4e30c1 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,32 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Build pull request + +on: + pull_request: + branches: [ master, main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Setup the workspace + run: ./gradlew setupCIWorkspace + + - name: Build the mod + run: ./gradlew build diff --git a/.github/workflows/gradle.yml b/.github/workflows/release.yml similarity index 93% rename from .github/workflows/gradle.yml rename to .github/workflows/release.yml index 7533889..6a64794 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,11 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: Java CI with Gradle +name: Build and release main branch on: push: branches: [ master, main ] - pull_request: - branches: [ master, main ] jobs: build: