Skip to content

Commit 9acc6f4

Browse files
committed
Added forum and Discord integrations to release action
1 parent 6027da7 commit 9acc6f4

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Upload release
22

33
env:
44
SPACEDOCK_MOD_ID: 3301
5+
SPACEDOCK_MOD_URL: "https://spacedock.info/mod/3301/Community%20Fixes#changelog" # The URL of your mod on SpaceDock"
6+
FORUM_TOPIC_URL: "https://forum.kerbalspaceprogram.com/topic/..." # The URL of your mod's forum topic
7+
FORUM_TOPIC_TITLE: "Community Fixes [v{version} for KSP2 v{ksp2_version}]" # The title of your mod's forum topic
8+
DISCORD_MOD_THREAD_ID: "1183537268565229648" # The thread ID of the mod's Discord post
9+
DISCORD_USERNAME: "Community Fixes" # The username of the bot that will post to Discord
10+
DISCORD_AVATAR_URL: "https://i.imgur.com/M4SUSaf.png" # The Image URL of the bot's avatar. Not required.
511

612
on:
713
release:
@@ -60,4 +66,35 @@ jobs:
6066
mod_id: ${{ env.SPACEDOCK_MOD_ID }}
6167
version: ${{ env.version }}
6268
zipball: ${{ env.zip }}
63-
changelog: ./changelog.md
69+
changelog: ./changelog.md
70+
71+
- name: Update Forum topic
72+
uses: Kerbalight/ksp2-forum-post-action@latest
73+
with:
74+
username: ${{ secrets.KSP_FORUM_USERNAME }}
75+
password: ${{ secrets.KSP_FORUM_PASSWORD }}
76+
forum_topic_url: ${{ env.FORUM_TOPIC_URL }}
77+
forum_topic_title: ${{ env.FORUM_TOPIC_TITLE }}
78+
spacedock_url: ${{ env.SPACEDOCK_MOD_URL}}
79+
version: ${{ env.version }}
80+
changelog: ./changelog.md
81+
82+
- name: Prepare message for Discord
83+
shell: bash
84+
run: |
85+
echo -e "## Release v${version}\n" > ./content.md
86+
cat ./changelog.md >> ./content.md
87+
{
88+
echo 'discord_message<<EOF'
89+
cat ./content.md
90+
echo EOF
91+
} >> "$GITHUB_ENV"
92+
93+
- name: Publish update to Discord
94+
uses: tsickert/[email protected]
95+
with:
96+
webhook-url: ${{ secrets.DISCORD_KMS_WEBHOOK_URL }}
97+
content: ${{ env.discord_message }}
98+
thread-id: ${{ env.DISCORD_MOD_THREAD_ID }}
99+
username: ${{ env.DISCORD_USERNAME }}
100+
avatar-url: ${{ env.DISCORD_AVATAR_URL }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ _UpgradeReport_Files/
3434
**/.idea/**/contentModel.xml
3535
**/.idea/**/modules.xml
3636

37+
# Rider plugins
38+
**/.idea/**/copilot/
39+
3740
# VS Code files
3841
.vscode/*
3942
!.vscode/settings.json

0 commit comments

Comments
 (0)