mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 15:37:44 +00:00
50 lines
1.7 KiB
YAML
50 lines
1.7 KiB
YAML
name: Release Social Post
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
post-release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract release info
|
|
id: release
|
|
run: |
|
|
TAG="${{ github.event.release.tag_name }}"
|
|
BODY="${{ github.event.release.body }}"
|
|
# Truncate body to ~400 chars for social media
|
|
SHORT_BODY=$(echo "$BODY" | head -5 | tr '\n' ' ' | cut -c1-400)
|
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
echo "body=$SHORT_BODY" >> $GITHUB_OUTPUT
|
|
echo "url=${{ github.event.release.html_url }}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Post to Mastodon
|
|
if: ${{ secrets.MASTODON_ACCESS_TOKEN != '' }}
|
|
run: |
|
|
STATUS="🚀 NexQuant ${{ steps.release.outputs.tag }} released!
|
|
|
|
${{ steps.release.outputs.body }}
|
|
|
|
${{ steps.release.outputs.url }}"
|
|
|
|
curl -s -X POST "${{ secrets.MASTODON_INSTANCE }}/api/v1/statuses" \
|
|
-H "Authorization: Bearer ${{ secrets.MASTODON_ACCESS_TOKEN }}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "$(jq -nc --arg status "$STATUS" '{"status": $status}')"
|
|
|
|
- name: Post to X (Twitter)
|
|
if: ${{ secrets.X_API_KEY != '' }}
|
|
uses: nearform-actions/github-action-notify-twitter@v3
|
|
with:
|
|
message: |
|
|
🚀 NexQuant ${{ steps.release.outputs.tag }} released!
|
|
${{ steps.release.outputs.url }}
|
|
twitter-api-key: ${{ secrets.X_API_KEY }}
|
|
twitter-api-secret-key: ${{ secrets.X_API_SECRET_KEY }}
|
|
twitter-access-token: ${{ secrets.X_ACCESS_TOKEN }}
|
|
twitter-access-token-secret: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
|