|
1 | 1 | name: Build MudletBootstrap |
2 | 2 | on: |
3 | 3 | push: |
4 | | - branches: [master] |
| 4 | + branches: [master, development] |
| 5 | + tags: |
| 6 | + - 'v*' # Add tag trigger for releases |
5 | 7 | pull_request: |
6 | 8 | workflow_dispatch: |
7 | 9 |
|
@@ -164,13 +166,13 @@ jobs: |
164 | 166 |
|
165 | 167 | - name: (Windows) Login to Azure |
166 | 168 | uses: azure/login@v2 |
167 | | - if: runner.os == 'Windows' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' |
| 169 | + if: runner.os == 'Windows' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && github.repository == 'Mudlet/Mudlet' |
168 | 170 | with: |
169 | 171 | creds: ${{ secrets.AZURE_CREDENTIALS }} |
170 | 172 |
|
171 | 173 | - name: Get Azure access token for code signing |
172 | 174 | shell: pwsh |
173 | | - if: runner.os == 'Windows' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' |
| 175 | + if: runner.os == 'Windows' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && github.repository == 'Mudlet/Mudlet' |
174 | 176 | run: | |
175 | 177 | $token = (az account get-access-token --resource https://codesigning.azure.net | ConvertFrom-Json).accessToken |
176 | 178 | "::add-mask::$token" |
@@ -206,3 +208,112 @@ jobs: |
206 | 208 | name: ${{env.UPLOAD_FILENAME}} |
207 | 209 | path: ${{env.FOLDER_TO_UPLOAD}} |
208 | 210 |
|
| 211 | + release: |
| 212 | + if: startsWith(github.ref, 'refs/tags/') |
| 213 | + needs: compile |
| 214 | + runs-on: ubuntu-latest |
| 215 | + |
| 216 | + steps: |
| 217 | + - name: Checkout Source (for GameList.txt) |
| 218 | + uses: actions/checkout@v5 |
| 219 | + |
| 220 | + - name: Download all platform artifacts |
| 221 | + uses: actions/download-artifact@v4 |
| 222 | + with: |
| 223 | + path: ./platform-artifacts |
| 224 | + |
| 225 | + - name: Organize launchers by game |
| 226 | + run: | |
| 227 | + chmod +x $GITHUB_WORKSPACE/CI/organize-launchers.sh |
| 228 | + $GITHUB_WORKSPACE/CI/organize-launchers.sh |
| 229 | + |
| 230 | + - name: Generate release body |
| 231 | + run: | |
| 232 | + echo "=== Generating release body ===" |
| 233 | + |
| 234 | + # Get repository and tag info |
| 235 | + REPO="${{ github.repository }}" |
| 236 | + TAG="${{ github.ref_name }}" |
| 237 | + BASE_URL="https://github.com/$REPO/releases/download/$TAG" |
| 238 | + |
| 239 | + echo "Base URL: $BASE_URL" |
| 240 | +
|
| 241 | + # Start building the release body |
| 242 | + cat > release-body.md << 'EOF' |
| 243 | + ## MudletBootstrap Release ${{ github.ref_name }} |
| 244 | + |
| 245 | + Choose your game below and download the appropriate file for your operating system: |
| 246 | + |
| 247 | + EOF |
| 248 | + |
| 249 | + # Add each game as a section |
| 250 | + if [ -d "organized-releases" ]; then |
| 251 | + for game_dir in organized-releases/*/; do |
| 252 | + if [ -d "$game_dir" ]; then |
| 253 | + game_name=$(basename "$game_dir") |
| 254 | + echo "### $game_name" >> release-body.md |
| 255 | + echo "" >> release-body.md |
| 256 | + |
| 257 | + # Check for each platform |
| 258 | + windows_file=$(find "$game_dir" -name "*Windows.exe" | head -1) |
| 259 | + macos_file=$(find "$game_dir" -name "*macOS.dmg" | head -1) |
| 260 | + linux_file=$(find "$game_dir" -name "*Linux.AppImage.tar" | head -1) |
| 261 | + |
| 262 | + if [ -n "$windows_file" ]; then |
| 263 | + filename=$(basename "$windows_file") |
| 264 | + echo "- **Windows**: [\`$filename\`]($BASE_URL/$filename)" >> release-body.md |
| 265 | + fi |
| 266 | + |
| 267 | + if [ -n "$macos_file" ]; then |
| 268 | + filename=$(basename "$macos_file") |
| 269 | + echo "- **macOS**: [\`$filename\`]($BASE_URL/$filename)" >> release-body.md |
| 270 | + fi |
| 271 | + |
| 272 | + if [ -n "$linux_file" ]; then |
| 273 | + filename=$(basename "$linux_file") |
| 274 | + echo "- **Linux**: [\`$filename\`]($BASE_URL/$filename)" >> release-body.md |
| 275 | + fi |
| 276 | + |
| 277 | + echo "" >> release-body.md |
| 278 | + fi |
| 279 | + done |
| 280 | + fi |
| 281 | + |
| 282 | + # Add installation instructions |
| 283 | + cat >> release-body.md << 'EOF' |
| 284 | + ## Installation Instructions |
| 285 | + |
| 286 | + ### Windows |
| 287 | + 1. Download the `.exe` file for your game |
| 288 | + 2. Run MudletBootstrap - it'll download & install Mudlet for you |
| 289 | + 3. You can delete MudletBootstrap after - Mudlet is all set up to play your favourite game. |
| 290 | + |
| 291 | + ### macOS |
| 292 | + 1. Download the `.dmg` file for your game |
| 293 | + 2. Open the DMG file |
| 294 | + 3. Runt he MudletBootstrap app from within the mounted DMG |
| 295 | + |
| 296 | + ### Linux |
| 297 | + 1. Download the `.AppImage.tar` file for your game |
| 298 | + 2. Extract it: `tar -xf MudletBootstrap-[game]-Linux.AppImage.tar` |
| 299 | + 2. Extract and run the AppImage within: `MudletBootstrap-[game].AppImage` |
| 300 | + 3. You can delete MudletBootstrap after - Mudlet is all set up to play your favourite |
| 301 | + EOF |
| 302 | + |
| 303 | + echo "Generated release body:" |
| 304 | + cat release-body.md |
| 305 | +
|
| 306 | + - name: Create Release with Game Organization |
| 307 | + uses: softprops/action-gh-release@v1 |
| 308 | + with: |
| 309 | + files: organized-releases/**/* |
| 310 | + tag_name: ${{ github.ref_name }} |
| 311 | + name: MudletBootstrap ${{ github.ref_name }} |
| 312 | + body_path: release-body.md |
| 313 | + draft: false |
| 314 | + prerelease: false |
| 315 | + generate_release_notes: false |
| 316 | + env: |
| 317 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 318 | + |
| 319 | + |
0 commit comments