name: CF CI

on:
  push:
    branches:
      - 3.x
      - 4.x-unstable
      - 4.x
      - 5.x
      - 6.x
      - 6.x-1.17
      - 7.x-1.18
      - 8.x-1.18.2
      - 9.x-1.19

jobs:
  build:
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, 'ci skip')"
    steps:
      - uses: actions/checkout@v1
      - name: Set up JDK 17
        uses: actions/setup-java@v1
        with:
          java-version: 17
      - name: Upload Mod
        run: ./gradlew build publish forge:publishUnified fabric:publishUnified jei-internals-workaround:publishUnified --stacktrace
        env:
          danielshe_curse_api_key: ${{ secrets.CF_API_KEY }}
          modrinth_key: ${{ secrets.MODRINTH_KEY }}
          BRANCH_NAME: ${{ github.ref }}
          MAVEN_PASS: ${{ secrets.MAVEN_PASS }}