2023-04-27 23:35:26 -07:00
|
|
|
name: Social
|
2022-11-27 10:39:42 -08:00
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
2023-04-28 11:59:28 -07:00
|
|
|
release-notes:
|
2022-11-27 10:39:42 -08:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-28 11:59:28 -07:00
|
|
|
outputs:
|
|
|
|
notes: ${{ steps.notes.outputs.result }}
|
2022-11-27 10:39:42 -08:00
|
|
|
steps:
|
|
|
|
- name: Notes 📝
|
|
|
|
id: notes
|
2023-04-06 18:02:52 -07:00
|
|
|
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
|
2022-11-27 10:39:42 -08:00
|
|
|
with:
|
2022-11-28 22:06:30 -08:00
|
|
|
result-encoding: string
|
2022-11-27 10:39:42 -08:00
|
|
|
script: |
|
|
|
|
notes = context.payload.release.body
|
|
|
|
|
|
|
|
// replace all non-supported characters
|
|
|
|
notes = notes.replaceAll('###', '')
|
|
|
|
notes = notes.replaceAll('**', '')
|
|
|
|
notes = notes.replace(/ \(\[[0-9a-z]+\]\(.*\)/g, '')
|
|
|
|
notes = notes.trim()
|
|
|
|
return notes
|
2023-04-28 11:59:28 -07:00
|
|
|
bluesky:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: release-notes
|
|
|
|
steps:
|
|
|
|
- name: Post 🌤️
|
2023-04-25 23:31:07 -07:00
|
|
|
id: bluesky
|
|
|
|
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
|
2023-04-25 09:07:21 -07:00
|
|
|
with:
|
2023-04-25 23:31:07 -07:00
|
|
|
script: |
|
2023-04-27 23:35:26 -07:00
|
|
|
const { BskyAgent } = require('@atproto/api')
|
2023-04-25 23:31:07 -07:00
|
|
|
|
|
|
|
const agent = new BskyAgent({ service: 'https://bsky.social' })
|
|
|
|
await agent.login({identifier: '${{ secrets.BLUESKY_IDENTIFIER }}', password: '${{ secrets.BLUESKY_PASSWORD }}'})
|
|
|
|
|
2023-04-26 07:37:07 -07:00
|
|
|
const version = '${{ github.event.release.name }}';
|
2023-04-28 11:59:28 -07:00
|
|
|
const notes = `${{ needs.release-notes.outputs.notes }}`;
|
2023-04-25 09:07:21 -07:00
|
|
|
|
2023-04-26 07:37:07 -07:00
|
|
|
const text = `📦 ${version}
|
2023-04-25 09:07:21 -07:00
|
|
|
|
2023-04-26 07:37:07 -07:00
|
|
|
${notes}
|
2023-04-25 09:07:21 -07:00
|
|
|
|
2023-04-25 23:31:07 -07:00
|
|
|
#ohmyposh #oss #cli #opensource`;
|
|
|
|
|
2023-04-26 07:37:07 -07:00
|
|
|
await agent.post({
|
|
|
|
text: text,
|
|
|
|
embed: {
|
|
|
|
$type: 'app.bsky.embed.external',
|
|
|
|
external: {
|
|
|
|
uri: `https://github.com/JanDeDobbeleer/oh-my-posh/releases/tag/${version}`,
|
|
|
|
title: "GitHub release",
|
|
|
|
description: version,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
2023-04-28 11:59:28 -07:00
|
|
|
mastodon:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: release-notes
|
|
|
|
steps:
|
2022-11-27 10:39:42 -08:00
|
|
|
- name: Toot 🐘
|
2023-01-10 16:36:42 -08:00
|
|
|
uses: cbrgm/mastodon-github-action@d98ab3376f941df14d37d5737961de431c0838c6
|
2022-11-27 10:39:42 -08:00
|
|
|
with:
|
2022-11-28 22:06:30 -08:00
|
|
|
message: |
|
|
|
|
📦 ${{ github.event.release.name }}
|
|
|
|
|
2023-04-28 11:59:28 -07:00
|
|
|
${{ needs.release-notes.outputs.notes }}
|
2022-11-28 22:06:30 -08:00
|
|
|
|
|
|
|
${{ github.event.release.html_url }}
|
|
|
|
|
|
|
|
#ohmyposh #oss #cli #opensource
|
2022-11-27 10:39:42 -08:00
|
|
|
visibility: "public"
|
|
|
|
env:
|
2023-04-28 02:40:34 -07:00
|
|
|
MASTODON_URL: "https://hachyderm.io/"
|
2022-11-27 10:39:42 -08:00
|
|
|
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
|