diff --git a/.github/workflows/gradle_template.yml b/.github/workflows/gradle_template.yml index 2274e45..482e51c 100644 --- a/.github/workflows/gradle_template.yml +++ b/.github/workflows/gradle_template.yml @@ -1,4 +1,5 @@ -name: Gradle CI +# https://github.com/MinecraftForge/SharedActions/blob/main/.github/workflows/gradle.yml +name: Gradle publishing CI on: workflow_call: @@ -9,7 +10,7 @@ on: type: string default: "17" gradle_tasks: - description: "The Gradle tasks to run" + description: "The Gradle task(s) to run" required: false type: string default: "publish" @@ -36,22 +37,33 @@ permissions: contents: read jobs: - notify-discord-start: + notify-build-start: + name: Build notifications (start) runs-on: ubuntu-latest outputs: version: ${{ steps.version.outputs.version }} steps: - uses: matyrobbrt/actions-tag-versioning@main + name: Calculate version id: version env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: matyrobbrt/action-webhooks@main + name: Send Discord start notification with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} status: 'started' version: ${{ steps.version.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: Sibz/github-status-action@v1 + name: Set pending status + with: + authToken: ${{secrets.GITHUB_TOKEN}} + context: 'Publishing' + state: 'pending' + description: "Version: ${{ steps.version.outputs.version }}" + target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} gradle: runs-on: ubuntu-latest @@ -63,7 +75,7 @@ jobs: - name: Make Gradle executable # language=bash - run: chmod +x ./gradlew + run: chmod +x ./gradlew # Thanks Windows - name: Setup Java ${{ inputs.java }} # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#java @@ -79,17 +91,28 @@ jobs: MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - notify-discord-end: - name: Notify Discord (end) - needs: [ "notify-discord-start", "gradle" ] + notify-build-end: + name: Build notifications (end) + needs: [ "notify-build-start", "gradle" ] if: ${{ always() }} runs-on: ubuntu-latest steps: - uses: matyrobbrt/action-webhooks@main + name: Send Discord end notification with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} status: ${{ needs.gradle.result }} - version: ${{ needs.notify-discord-start.outputs.version }} + version: ${{ needs.notify-build-start.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: Sibz/github-status-action@v1 + name: Set build status + with: + authToken: ${{secrets.GITHUB_TOKEN}} + context: 'Publishing' + state: ${{ needs.gradle.result }} + description: "Version: ${{ needs.notify-build-start.outputs.version }}" + target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}