v0.2.2 #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload release | |
env: | |
SPACEDOCK_MOD_ID: 3484 | |
on: | |
release: | |
types: [ "published" ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Download NuGet | |
id: download-nuget | |
run: sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | |
- name: Install jq | |
uses: dcarbone/[email protected] | |
- name: Build the solution | |
run: dotnet build "CommunityResources.sln" -c Release | |
- name: Extract current version | |
id: get-version | |
run: | | |
version=$(jq -r '.version' plugin_template/swinfo.json) | |
echo "Version is $version" | |
echo "version=$version" >> $GITHUB_ENV | |
echo "release_filename=CommunityResources-$version.zip" >> $GITHUB_ENV | |
echo "zip=$(ls -1 dist/CommunityResources-*.zip | head -n 1)" >> $GITHUB_ENV | |
echo "upload_url=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].upload_url' | tr -d \")" >> $GITHUB_ENV | |
wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq -r '.[0].body' > ./changelog.md | |
- name: Upload zip to release | |
uses: shogo82148/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ env.upload_url }} | |
asset_path: ${{ env.zip }} | |
asset_name: ${{ env.release_filename }} | |
asset_content_type: application/zip | |
- name: Add Mask | |
run: echo "::add-mask::${{ secrets.SPACEDOCK_PASSWORD }}" | |
- name: Update mod on SpaceDock | |
uses: KSP2Community/[email protected] | |
with: | |
username: ${{ secrets.SPACEDOCK_USER }} | |
password: ${{ secrets.SPACEDOCK_PASSWORD }} | |
game_id: 22407 | |
mod_id: ${{ env.SPACEDOCK_MOD_ID }} | |
version: ${{ env.version }} | |
zipball: ${{ env.zip }} | |
changelog: ./changelog.md |