-
-
Notifications
You must be signed in to change notification settings - Fork 25
90 lines (84 loc) · 3.1 KB
/
Copy pathcrosspost.yml
File metadata and controls
90 lines (84 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "Crosspost Release to Social Media"
on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: Release tag to crosspost (for dispatches from release workflow)
required: true
type: string
env:
RELEASE_TAG: ${{ github.event.inputs.tag }}
jobs:
validate:
name: "Validate release exists"
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Verify release tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ env.RELEASE_TAG }}
run: gh release view "$RELEASE_TAG" --repo "${{ github.repository }}"
crosspost:
name: "Crosspost to Social Media"
needs: validate
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Crosspost to Bluesky and Mastodon
uses: tgagor/action-crosspost@9523ff489bc74e1a9849c5d3071b6bcbad40042d # v1.6.3
with:
feed-url: https://github.com/${{ github.repository }}/releases.atom
limit: 1
since: 15
filter-urls: |
/releases/tag/${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.event.release.tag_name }}
message: |
🎉 New release of ${{ github.event.repository.name }} is out!
{url}
#Java #JavaDecompiler #OpenSource #ReverseEngineering
bluesky-host: bsky.social
bluesky-identifier: ${{ secrets.BLUESKY_IDENTIFIER }}
bluesky-password: ${{ secrets.BLUESKY_PASSWORD }}
mastodon-access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
mastodon-host: ${{ secrets.MASTODON_HOST }}
devto:
name: "Publish to Dev.to"
needs: validate
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Create release post
env:
RELEASE_TAG: ${{ env.RELEASE_TAG }}
REPOSITORY_NAME: ${{ github.event.repository.name }}
REPOSITORY: ${{ github.repository }}
run: |
OPENGRAPH_CACHE_KEY="$(openssl rand -hex 32)"
POST_FILE="posts/release-${RELEASE_TAG}.md"
mkdir -p "$(dirname "$POST_FILE")"
if [ ! -f "$POST_FILE" ]; then
cat > "$POST_FILE" << EOF
---
title: "🎉 New release of ${REPOSITORY_NAME} ${RELEASE_TAG} is out!"
published: true
description: "New release of ${REPOSITORY_NAME}"
tags: java, decompiler, opensource, reverseengineering
---
[](https://github.com/${REPOSITORY}/releases/tag/${RELEASE_TAG})
EOF
fi
- name: Publish to Dev.to
uses: sinedied/publish-devto@c713cc0934b35cb3df9fca759b98e36e6a540a85 # v2
with:
devto_key: ${{ secrets.DEVTO_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
files: 'posts/release-${{ env.RELEASE_TAG }}.md'
branch: master
conventional_commits: false