Sunshine/.github/workflows/release-notifier.yml

104 lines
3.7 KiB
YAML
Raw Normal View History

2022-08-07 20:26:40 -04:00
---
2022-07-30 15:14:28 -04:00
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
2023-01-01 09:36:24 -05:00
# Send release notification to various platforms.
2022-07-30 15:14:28 -04:00
name: Release Notifications
on:
release:
types: [published]
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onevent_nametypes
jobs:
discord:
2023-10-12 12:22:23 -04:00
if: >-
2023-12-04 18:12:14 -05:00
startsWith(github.repository, 'LizardByte/') &&
not(github.event.release.prerelease) &&
2023-10-12 12:22:23 -04:00
not(github.event.release.draft)
2022-07-30 15:14:28 -04:00
runs-on: ubuntu-latest
steps:
- name: discord
2023-10-12 12:22:23 -04:00
uses: sarisia/actions-status-discord@v1
2022-07-30 15:14:28 -04:00
with:
webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
nodetail: true
nofail: false
username: ${{ secrets.DISCORD_USERNAME }}
avatar_url: ${{ secrets.ORG_LOGO_URL }}
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
description: ${{ github.event.release.body }}
color: 0xFF4500
facebook_group:
2023-10-12 12:22:23 -04:00
if: >-
2023-12-04 18:12:14 -05:00
startsWith(github.repository, 'LizardByte/') &&
not(github.event.release.prerelease) &&
2023-10-12 12:22:23 -04:00
not(github.event.release.draft)
2022-07-30 15:14:28 -04:00
runs-on: ubuntu-latest
steps:
- name: facebook-post-action
2023-10-12 12:22:23 -04:00
uses: ReenigneArcher/facebook-post-action@v1
2022-07-30 15:14:28 -04:00
with:
page_id: ${{ secrets.FACEBOOK_GROUP_ID }}
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
message: |
${{ github.event.repository.name }} ${{ github.ref_name }} Released
${{ github.event.release.body }}
url: ${{ github.event.release.html_url }}
facebook_page:
2023-10-12 12:22:23 -04:00
if: >-
2023-12-04 18:12:14 -05:00
startsWith(github.repository, 'LizardByte/') &&
not(github.event.release.prerelease) &&
2023-10-12 12:22:23 -04:00
not(github.event.release.draft)
2022-07-30 15:14:28 -04:00
runs-on: ubuntu-latest
steps:
- name: facebook-post-action
2023-10-12 12:22:23 -04:00
uses: ReenigneArcher/facebook-post-action@v1
2022-07-30 15:14:28 -04:00
with:
page_id: ${{ secrets.FACEBOOK_PAGE_ID }}
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
message: |
${{ github.event.repository.name }} ${{ github.ref_name }} Released
${{ github.event.release.body }}
url: ${{ github.event.release.html_url }}
reddit:
2023-10-12 12:22:23 -04:00
if: >-
2023-12-04 18:12:14 -05:00
startsWith(github.repository, 'LizardByte/') &&
not(github.event.release.prerelease) &&
2023-10-12 12:22:23 -04:00
not(github.event.release.draft)
2022-07-30 15:14:28 -04:00
runs-on: ubuntu-latest
steps:
- name: reddit
2023-10-12 12:22:23 -04:00
uses: bluwy/release-for-reddit-action@v2
2022-07-30 15:14:28 -04:00
with:
username: ${{ secrets.REDDIT_USERNAME }}
password: ${{ secrets.REDDIT_PASSWORD }}
app-id: ${{ secrets.REDDIT_CLIENT_ID }}
app-secret: ${{ secrets.REDDIT_CLIENT_SECRET }}
subreddit: ${{ secrets.REDDIT_SUBREDDIT }}
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
url: ${{ github.event.release.html_url }}
flair-id: ${{ secrets.REDDIT_FLAIR_ID }} # https://www.reddit.com/r/<subreddit>>/api/link_flair.json
comment: ${{ github.event.release.body }}
twitter:
2023-10-12 12:22:23 -04:00
if: >-
2023-12-04 18:12:14 -05:00
startsWith(github.repository, 'LizardByte/') &&
not(github.event.release.prerelease) &&
2023-10-12 12:22:23 -04:00
not(github.event.release.draft)
2022-07-30 15:14:28 -04:00
runs-on: ubuntu-latest
steps:
- name: twitter
2023-10-12 12:22:23 -04:00
uses: nearform-actions/github-action-notify-twitter@v1
2022-07-30 15:14:28 -04:00
with:
2023-10-12 12:22:23 -04:00
message: ${{ github.event.release.html_url }}
twitter-app-key: ${{ secrets.TWITTER_API_KEY }}
twitter-app-secret: ${{ secrets.TWITTER_API_SECRET }}
twitter-access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
twitter-access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}