Publish v5.1-beta2 #24
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: MSUF | |
| run-name: Publish ${{ github.event.release.tag_name || inputs.tag_name }} | |
| on: | |
| release: | |
| types: | |
| - published | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: Release tag to publish | |
| required: true | |
| type: string | |
| prerelease: | |
| description: Publish as beta on Wago and CurseForge | |
| required: true | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| RELEASE_VERSION: ${{ github.event.release.tag_name || inputs.tag_name }} | |
| RELEASE_IS_PRERELEASE: ${{ github.event.release.prerelease || inputs.prerelease }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.release.tag_name || inputs.tag_name }} | |
| - name: Validate publishing config | |
| shell: pwsh | |
| env: | |
| WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }} | |
| run: | | |
| $missing = @() | |
| if ([string]::IsNullOrWhiteSpace($env:WAGO_API_TOKEN)) { | |
| $missing += "secret WAGO_API_TOKEN" | |
| } | |
| if ($missing.Count -gt 0) { | |
| throw "Missing release publishing config: $($missing -join ', ')" | |
| } | |
| - name: Build AddOns zip | |
| shell: pwsh | |
| run: | | |
| ./tools/package-release.ps1 -Version $env:RELEASE_VERSION | |
| - name: Upload to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.RELEASE_VERSION }} | |
| files: dist/*.zip | |
| body_path: CHANGELOG.md | |
| fail_on_unmatched_files: true | |
| overwrite_files: true | |
| - name: Upload to Wago | |
| shell: pwsh | |
| env: | |
| WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }} | |
| run: | | |
| $zip = Get-ChildItem -Path dist -Filter "*.zip" | Select-Object -First 1 | |
| if (-not $zip) { | |
| throw "No release zip found in dist." | |
| } | |
| if ($env:RELEASE_IS_PRERELEASE -eq "true") { | |
| ./tools/publish-wago.ps1 -Version $env:RELEASE_VERSION -ZipPath $zip.FullName -Prerelease | |
| } else { | |
| ./tools/publish-wago.ps1 -Version $env:RELEASE_VERSION -ZipPath $zip.FullName | |
| } |