mirror of
https://github.com/fleetbase/fleetbase.git
synced 2025-12-19 14:18:57 +00:00
use release.md for discord announcement
This commit is contained in:
45
.github/workflows/discord-announcement.yml
vendored
45
.github/workflows/discord-announcement.yml
vendored
@@ -1,9 +1,8 @@
|
|||||||
name: Discord Announcement
|
name: Discord Announcement
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
tags:
|
types: [published]
|
||||||
- "v*"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
discord_announcement:
|
discord_announcement:
|
||||||
@@ -11,38 +10,30 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: Read release notes
|
||||||
- name: Get tag message
|
id: notes
|
||||||
id: tag
|
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=version::$(git describe --tags --abbrev=0)"
|
body="$(cat RELEASE.md)"
|
||||||
if [[ "${ACT}" == "true" ]]; then
|
echo "::set-output name=message::$(echo "${body}" | base64 -w0)"
|
||||||
# If running with act, use an environment variable for the tag message
|
|
||||||
echo "::set-output name=message::$(echo -e "${TAG_MESSAGE}" | base64)"
|
|
||||||
else
|
|
||||||
# If running on GitHub, use git to get the tag message
|
|
||||||
echo "::set-output name=message::$(git tag -l --format='%(contents)' $(git describe --tags --abbrev=0) | base64)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Print tag message
|
|
||||||
run: echo "${{ steps.tag.outputs.message }}"
|
|
||||||
|
|
||||||
- name: Get tag name
|
- name: Get tag name
|
||||||
id: get_tag
|
id: tag
|
||||||
run: echo "::set-output name=tag::${GITHUB_REF/refs\/tags\//}"
|
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
|
||||||
|
- name: Decode notes
|
||||||
- name: Decode message
|
|
||||||
id: decode
|
id: decode
|
||||||
run: |
|
run: |
|
||||||
echo "Decoding message..."
|
echo "::set-output name=text::$(echo '${{ steps.notes.outputs.message }}' | base64 --decode)"
|
||||||
echo "::set-output name=message::$(echo '${{ steps.tag.outputs.message }}' | base64 --decode)"
|
|
||||||
|
|
||||||
- name: Send message to Discord
|
- name: Send message to Discord
|
||||||
uses: tsickert/discord-webhook@v5.3.0
|
uses: tsickert/discord-webhook@v5.3.0
|
||||||
with:
|
with:
|
||||||
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
content: "@everyone \n📦 New Fleetbase Version ${{ steps.get_tag.outputs.tag }} Released!\n${{ steps.decode.outputs.message }} \nVersion: ${{ steps.get_tag.outputs.tag }} \n[Release Notes for ${{ steps.get_tag.outputs.tag }}](https://github.com/fleetbase/fleetbase/releases/tag/${{ steps.get_tag.outputs.tag }})"
|
|
||||||
username: Fleetbase
|
username: Fleetbase
|
||||||
|
content: |
|
||||||
|
@everyone
|
||||||
|
📦 **Fleetbase ${{ steps.tag.outputs.tag }} released!**
|
||||||
|
|
||||||
|
${{ steps.decode.outputs.text }}
|
||||||
|
|
||||||
|
[View full notes on GitHub](https://github.com/fleetbase/fleetbase/releases/tag/${{ steps.tag.outputs.tag }})
|
||||||
Reference in New Issue
Block a user