diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5091d06..85c1e9f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -223,3 +223,32 @@ jobs: -H 'Content-Type: application/json' \ --data '{"ForceOverwrite": true}' \ "${{ secrets.APTLY_API }}/publish/${{ needs.meta.outputs.aptly_publish_prefix }}/${{ needs.meta.outputs.aptly_dist }}?_async=true" + + ntfy: + name: Ntfy + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + needs: meta + steps: + - name: Send success notification + uses: niniyas/ntfy-action@master + if: ${{ success() && (needs.meta.outputs.is_release == 'true' || needs.meta.outputs.is_prerelease == 'true') }} + with: + url: 'https://ntfy.cdzombak.net' + topic: 'gha-builds' + priority: 3 + headers: '{"authorization": "Bearer ${{ secrets.NTFY_TOKEN }}"}' + tags: white_check_mark + title: ${{ github.event.repository.name }} ${{ needs.meta.outputs.bin_version }} available + details: ${{ github.event.repository.name }} version ${{ needs.meta.outputs.bin_version }} is now available. + - name: Send failure notification + uses: niniyas/ntfy-action@master + if: ${{ failure() }} + with: + url: 'https://ntfy.cdzombak.net' + topic: 'gha-builds' + priority: 3 + headers: '{"authorization": "Bearer ${{ secrets.NTFY_TOKEN }}"}' + tags: no_entry + title: ${{ github.event.repository.name }} ${{ needs.meta.outputs.bin_version }} build failed + details: Build failed for ${{ github.event.repository.name }} version ${{ needs.meta.outputs.bin_version }}.