Publish Release #116
This file contains hidden or 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: Publish Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| mod: | |
| description: 'Which mod?' | |
| required: true | |
| type: choice | |
| options: | |
| - 'Industries Rework - Food;3330261506' | |
| - 'Industries Rework - Military;3324254588' | |
| - 'Industries Rework - Ranches;3394847149' | |
| - 'Populist Legal Power;3351014672' | |
| - 'Populist Legal Innovation;3609384092' | |
| - 'Sinosphere Korean;3108195724' | |
| - 'Smarter Private Construction;3115017647' | |
| - 'Soft Econ Adjustments;3345217364' | |
| - 'Soft Pop Adjustments;3336914177' | |
| - 'SPA BITC;3577410223' | |
| - 'Subject Interaction Suite;3276243851' | |
| - 'SIS BITC;3577518455' | |
| - 'Tweaked Starting Conditions;3306851845' | |
| - 'Urban Synergy Unleashed;3371689443' | |
| - 'USU LLWA;3387021675' | |
| - 'USU Morgenrote;3371690718' | |
| - 'Anti-Trust Patch;3587232850' | |
| update-description: | |
| description: 'Update description?' | |
| required: true | |
| default: 'true' | |
| type: choice | |
| options: | |
| - 'true' | |
| - 'false' | |
| jobs: | |
| release: | |
| name: "Publish Release" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.2.2 | |
| - name: Setup Metadata | |
| id: metadata | |
| run: script/split-mod.sh "${{ inputs.mod }}" | |
| - name: Clean Repository | |
| run: | | |
| mkdir ../steam-release | |
| mv "${{ steps.metadata.outputs.mod-name }}/STEAM_PAGE.bbcode" ../steam-release/STEAM_PAGE.bbcode | |
| rm -f "${{ steps.metadata.outputs.mod-name }}/vic3-tiger.conf" | |
| rm -f "${{ steps.metadata.outputs.mod-name }}/design_notes.txt" | |
| # Use rm -f for files and rm -rf for folders. | |
| # Create mod metadata for the steam release | |
| # Uses STEAM_PAGE.bbcode to update steam description | |
| - name: Create Workshop Metadata with Description | |
| if: ${{ inputs.update-description == 'true' }} | |
| shell: bash | |
| run: | | |
| ./script/create-release-vdf.sh "${{ github.workspace }}/${{ steps.metadata.outputs.mod-name }}" "${{ steps.metadata.outputs.mod-id }}" ../steam-release/STEAM_PAGE.bbcode | |
| - name: Create Workshop Metadata without Description | |
| if: ${{ inputs.update-description == 'false' }} | |
| shell: bash | |
| run: | | |
| ./script/create-release-vdf.sh "${{ github.workspace }}/${{ steps.metadata.outputs.mod-name }}" "${{ steps.metadata.outputs.mod-id }}" | |
| # Report: Generated metadata | |
| - name: Process Workshop Metadata | |
| id: steam-metadata | |
| shell: bash | |
| run: | | |
| mv workshop.vdf ../steam-release/workshop.vdf | |
| echo "vdf=$(realpath ../steam-release/workshop.vdf)" >> "$GITHUB_OUTPUT" | |
| echo "# Workflow Metadata" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "$(cat < ../steam-release/workshop.vdf)" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| - name: Setup SteamCMD | |
| uses: CyberAndrii/setup-steamcmd@v1 | |
| # Publish to steam workshop | |
| # Uses generated metadata and configured workshop user | |
| - name: Publish to Workshop | |
| shell: bash | |
| run: | | |
| steamcmd +login ${{ secrets.WORKSHOP_USERNAME }} ${{ secrets.WORKSHOP_PASSWORD }} +workshop_build_item ${{ steps.steam-metadata.outputs.vdf }} +quit | |
| rm -rf "$STEAM_CMD" | |
| rm -rf "$STEAM_DIR" | |
| rm -rf "$STEAM_TEMP" | |
| #This method does not exist... T_T <- But I'm keeping this here because this approach would be superior if it ever gets supported, and I want it for reference if that happens one day. | |
| # - name: Publish description via Steam Web API | |
| # if: ${{ inputs.update-description == 'true' }} | |
| # env: | |
| # STEAM_WEB_API_KEY: ${{ secrets.STEAM_WEB_API_KEY }} | |
| # APPID: "529340" | |
| # MOD_ID: ${{ steps.metadata.outputs.mod-id }} | |
| # run: | | |
| # desc="$(< ../steam-release/STEAM_PAGE.bbcode)" | |
| # curl -X POST "https://api.steampowered.com/ISteamRemoteStorage/SetPublishedFileDetails/v1/" \ | |
| # -d "key=${STEAM_WEB_API_KEY}" \ | |
| # -d "appid=${APPID}" \ | |
| # -d "publishedfileid=${MOD_ID}" \ | |
| # --data-urlencode "description=${desc}" \ | |
| # || exit 1 |