diff --git a/.gitea/workflows/announce.yml b/.gitea/workflows/announce.yml new file mode 100644 index 0000000..2ec29cd --- /dev/null +++ b/.gitea/workflows/announce.yml @@ -0,0 +1,17 @@ +# Announce each published release on the community forum, in this project's +# Announcements category (coffey-labs/actions discourse-release; the repo -> +# category map is its release-map.json). Safe to re-run: one topic per tag. +name: announce + +on: + release: + types: [published] + +jobs: + announce: + runs-on: light + steps: + - uses: coffey-labs/actions/discourse-release@e9293996e2efa770839121fa8f8da93083f216be + with: + api-key: ${{ secrets.DISCOURSE_RELEASE_KEY }} + discord-webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index abe29b4..d4b553e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -94,3 +94,17 @@ jobs: --form "attachment=@$f" "$API/releases/$id/assets?name=$n" \ || { curl --silent "${auth[@]}" -X DELETE "$API/releases/$id"; exit 1; } done + + # The release above is made with the job's own token, and Gitea starts no + # workflow for events the Actions bot causes -- announce.yml's + # 'on: release' never fires for it -- so announce it from here. + announce: + needs: [release] + if: startsWith(github.ref, 'refs/tags/') + runs-on: light + steps: + - uses: coffey-labs/actions/discourse-release@e9293996e2efa770839121fa8f8da93083f216be + with: + api-key: ${{ secrets.DISCOURSE_RELEASE_KEY }} + discord-webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} + tag: ${{ github.ref_name }}