Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forum update workflow #293

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/forum_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Update Forum Topic
env:
FORUM_URL: 'https://forum.kerbalspaceprogram.com/topic/218490-space-warp-v190-for-ksp2-0200/'
FORUM_TITLE: 'Space Warp [v{version} for KSP2 {ksp2_version}]'

on:
workflow_dispatch:

jobs:
update_topic:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install jq
uses: dcarbone/[email protected]

- name: Extract current version
id: get-version
run: |
version=$(jq -r '.version' plugin_template/BepInEx/plugins/SpaceWarp/swinfo.json)
echo "Version is $version"
echo "version=$version" >> $GITHUB_ENV
wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq -r '.[0].body' > ./changelog.md

- name: Update mod topic
uses: Kerbalight/ksp2-forum-post-action@latest
with:
username: ${{ secrets.FORUM_USER }}
password: ${{ secrets.FORUM_PASSWORD }}
forum_topic_url: ${{ env.FORUM_URL }}
forum_topic_title: ${{ env.FORUM_TITLE }}
spacedock_url: https://spacedock.info/mod/3277/Space%20Warp%20+%20BepInEx
version: ${{ env.version }}
swinfo_path: 'plugin_template/BepInEx/plugins/SpaceWarp/swinfo.json'
changelog: ./changelog.md

Loading