diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml new file mode 100644 index 000000000..445ebf83c --- /dev/null +++ b/.github/workflows/github_release.yml @@ -0,0 +1,41 @@ +name: Publish Minecraft Mod Release + +on: + push: + branches: + - mc/1.20.1 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + + - name: Cache Gradle dependencies + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/settings.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Set executable permission for gradlew + run: chmod +x ./gradlew + + - name: Build Project + run: ./gradlew build + env: + JAVA_HOME: ${{ env.JAVA_HOME }} + + - name: Run Gradle githubRelease + run: ./gradlew githubRelease + env: + GITHUB_TOKEN: ${{ secrets.GITHUB }}