diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a789bfe --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Publish mod + +on: + push: + branches: [ "main" ] + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: Set up JDK 21 + uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0 + with: + java-version: '21' + distribution: 'temurin' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - run: ./gradlew build modrinth + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + - run: ./gradlew build publish + env: + MAVEN_REPO: ${{ secrets.MAVEN_REPO }} + MAVEN_AUTH_HEADER: ${{ secrets.MAVEN_AUTH_HEADER }} + MAVEN_AUTH_TOKEN: ${{ secrets.MAVEN_AUTH_TOKEN }}