diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml deleted file mode 100644 index 2c982b6e..00000000 --- a/.github/workflows/build-artifacts.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build artifacts -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-22.04 - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - name: Change wrapper permissions - run: chmod +x ./gradlew - - name: Cache Gradle dependencies - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.OS }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: | - ${{ runner.OS }}-gradle- diff --git a/.github/workflows/publish-sayanrepo.yml b/.github/workflows/publish-sayanrepo.yml deleted file mode 100644 index 940ce187..00000000 --- a/.github/workflows/publish-sayanrepo.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Publish Snapshots -on: - workflow_run: - workflows: ["Build artifacts"] - types: - - completed - -jobs: - publish_to_sayanrepo: - runs-on: ubuntu-22.04 - steps: - - name: Publish to SayanDevelopment snapshot repo - run: ./gradlew publish - env: - REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }} - REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }} diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml new file mode 100644 index 00000000..366cb2e4 --- /dev/null +++ b/.github/workflows/publish-snapshot.yml @@ -0,0 +1,56 @@ +name: Build artifacts +on: + push: + branches: + - master + +jobs: + build: + name: Build artifacts job + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + - name: Change wrapper permissions + run: chmod +x ./gradlew + - name: Cache Gradle dependencies + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.OS }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: | + ${{ runner.OS }}-gradle- + - name: Build artifacts + env: + REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }} + REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }} + run: ./gradlew build + - name: Publish to SayanDevelopment snapshot repo + run: ./gradlew publish + env: + REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }} + REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }} + - name: Publish to Hangar + env: + HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }} + HANGAR_BUILD_CHANNEL: Snapshot + HANGAR_CHANGELOG: ${{ github.event.release.body }} + REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }} + REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }} + run: ./gradlew build publishPluginPublicationToHangar --stacktrace + - name: Publish to Modrinth + run: ./gradlew modrinth + env: + MODRINTH_BUILD_CHANNEL: beta + MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_API_TOKEN }} + MODRINTH_CHANGELOG: ${{ github.event.release.body }} + REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }} + REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }} +