Rename bootstrap to installer (#35) #114
Workflow file for this run
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: Build MudletInstaller | |
| on: | |
| push: | |
| branches: [master, development] | |
| tags: | |
| - 'v*' # Add tag trigger for releases | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| compile: | |
| name: ${{matrix.buildname}} | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| buildname: 'Linux' | |
| triplet: x64-linux | |
| compiler: clang_64 | |
| qt: '6.9.1' | |
| - os: macos-13 | |
| buildname: 'macOS' | |
| triplet: x64-osx | |
| compiler: clang_64 | |
| qt: '6.9.1' | |
| - os: windows-2025 | |
| buildname: 'Windows' | |
| qt: '6.9.1' | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@v6 | |
| - name: (Linux, macOS) Install Qt | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: ${{matrix.qt}} | |
| dir: ${{runner.workspace}} | |
| cache: true | |
| - name: (Linux, macOS) Use CMake 4.1.0 | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| uses: lukka/get-cmake@v4.2.0 | |
| - name: (macOS) Install dependencies | |
| if: runner.os == 'macOS' | |
| env: | |
| HOMEBREW_NO_ANALYTICS: "ON" | |
| HOMEBREW_NO_AUTO_UPDATE: "ON" | |
| HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON" | |
| HOMEBREW_NO_INSTALL_CLEANUP: "ON" | |
| QT_VERSION: ${{ matrix.qt }} | |
| run: | | |
| # dependencies needed for vcpkg specifically. | |
| BREWS=("automake" "autoconf" "pkg-config" "ccache") | |
| # Loop through each brew package | |
| for brew in "${BREWS[@]}"; do | |
| if ! brew list --formula "${brew}" &>/dev/null; then | |
| echo "Installing ${brew}..." | |
| brew install "$brew" | |
| else | |
| echo "${brew} is already installed." | |
| fi | |
| done | |
| # Set these here so that vcpkg can use them. | |
| # Use latest available XCode | |
| echo "DEVELOPER_DIR=$(xcode-select --print-path)" >> $GITHUB_ENV | |
| echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV | |
| echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV | |
| - name: (Linux) Install dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install ccache pkg-config | |
| echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV | |
| - name: (Linux, macOS) Build Qt StateMachine Module | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| run: | | |
| # Make the build script executable and run it | |
| chmod +x ./CI/build-qt-statemachine.sh | |
| ./CI/build-qt-statemachine.sh | |
| - name: (Windows) Setup MSYS2 | |
| if: runner.os == 'Windows' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| - name: (Windows) Build Environment Setup | |
| if: runner.os == 'Windows' | |
| shell: msys2 {0} | |
| run: | | |
| $GITHUB_WORKSPACE/CI/setup-win-sdk.sh | |
| echo "QT_ROOT=${{runner.workspace}}/qt-static-install" >> $GITHUB_ENV | |
| - name: (Windows) Restore Qt cache | |
| if: runner.os == 'Windows' | |
| id: restore-qt | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{env.QT_ROOT}} | |
| key: qt | |
| - name: (Windows) Compile Qt | |
| if: runner.os == 'Windows' && steps.restore-qt.outputs.cache-hit != 'true' | |
| shell: msys2 {0} | |
| run: $GITHUB_WORKSPACE/CI/compile-qt-win.sh | |
| - name: (Windows) Save Qt cache | |
| if: runner.os == 'Windows' && steps.restore-qt.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{env.QT_ROOT}} | |
| key: ${{ steps.restore-qt.outputs.cache-primary-key }} | |
| - name: Restore ccache | |
| id: restore-ccache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{runner.workspace}}/ccache | |
| key: ccache-${{matrix.os}}-${{matrix.buildname}}-${{ github.sha }} | |
| restore-keys: ccache-${{matrix.os}}-${{matrix.buildname}} | |
| - name: check ccache stats prior to build | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| run: ccache --zero-stats --show-stats | |
| - name: (macOS, Linux) Build | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| env: | |
| CMAKE_PREFIX_PATH: ${{ env.QT_PREFIX != '' && env.QT_PREFIX || env.MINGW_BASE_DIR }} | |
| run: | | |
| chmod +x $GITHUB_WORKSPACE/CI/build-mac-linux.sh | |
| $GITHUB_WORKSPACE/CI/build-mac-linux.sh | |
| - name: (Windows) Build | |
| if: runner.os == 'Windows' | |
| shell: msys2 {0} | |
| run: $GITHUB_WORKSPACE/CI/build-win.sh | |
| - name: Save ccache | |
| if: always() && steps.restore-ccache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{runner.workspace}}/ccache | |
| key: ${{ steps.restore-ccache.outputs.cache-primary-key }} | |
| - name: check ccache stats post build | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| run: ccache --show-stats | |
| - name: (Windows) Package | |
| if: runner.os == 'Windows' | |
| shell: msys2 {0} | |
| run: $GITHUB_WORKSPACE/CI/package-win.sh | |
| - name: (Windows) Login to Azure | |
| uses: azure/login@v2 | |
| if: runner.os == 'Windows' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && github.repository == 'Mudlet/Mudlet' | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Get Azure access token for code signing | |
| shell: pwsh | |
| if: runner.os == 'Windows' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && github.repository == 'Mudlet/Mudlet' | |
| run: | | |
| $token = (az account get-access-token --resource https://codesigning.azure.net | ConvertFrom-Json).accessToken | |
| "::add-mask::$token" | |
| "AZURE_ACCESS_TOKEN=$token" | Add-Content -Path $env:GITHUB_ENV | |
| - name: (Windows) Deploy | |
| if: runner.os == 'Windows' | |
| shell: msys2 {0} | |
| env: | |
| AZURE_ACCESS_TOKEN: ${{ env.AZURE_ACCESS_TOKEN }} | |
| run: $GITHUB_WORKSPACE/CI/deploy-win.sh | |
| - name: (macOS) Prep for Artifact Upload | |
| if: runner.os == 'macOS' | |
| env: | |
| BUILD_DIR: ${{runner.workspace}}/build | |
| MACOS_SIGNING_PASS: ${{github.actor != 'dependabot[bot]' && secrets.MACOS_SIGNING_PASS || ''}} | |
| APPLE_USERNAME: ${{secrets.APPLE_USERNAME}} | |
| APPLE_PASSWORD: ${{secrets.APPLE_PASSWORD}} | |
| APPLE_TEAM_ID: ${{secrets.APPLE_TEAM_ID}} | |
| run: | | |
| chmod +x $GITHUB_WORKSPACE/CI/package-mac.sh | |
| $GITHUB_WORKSPACE/CI/package-mac.sh | |
| - name: (Linux) Prep for Artifact Upload | |
| if: runner.os == 'Linux' | |
| env: | |
| BUILD_DIR: ${{runner.workspace}}/build | |
| run: | | |
| chmod +x $GITHUB_WORKSPACE/CI/package-linux.sh | |
| $GITHUB_WORKSPACE/CI/package-linux.sh | |
| - name: Upload Packaged Product | |
| uses: actions/upload-artifact@v4 | |
| if: env.UPLOAD_FILENAME | |
| with: | |
| name: ${{env.UPLOAD_FILENAME}} | |
| path: ${{env.FOLDER_TO_UPLOAD}} | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: compile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Source (for GameList.txt) | |
| uses: actions/checkout@v6 | |
| - name: Download all platform artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| path: ./platform-artifacts | |
| - name: Organize launchers by game | |
| run: | | |
| chmod +x $GITHUB_WORKSPACE/CI/organize-launchers.sh | |
| $GITHUB_WORKSPACE/CI/organize-launchers.sh | |
| - name: Generate release body | |
| run: | | |
| echo "=== Generating release body ===" | |
| # Get repository and tag info | |
| REPO="${{ github.repository }}" | |
| TAG="${{ github.ref_name }}" | |
| BASE_URL="https://github.com/$REPO/releases/download/$TAG" | |
| echo "Base URL: $BASE_URL" | |
| # Start building the release body | |
| cat > release-body.md << 'EOF' | |
| ## MudletInstaller Release ${{ github.ref_name }} | |
| Choose your game below and download the appropriate file for your operating system: | |
| EOF | |
| # Add each game as a section | |
| if [ -d "organized-releases" ]; then | |
| for game_dir in organized-releases/*/; do | |
| if [ -d "$game_dir" ]; then | |
| game_name=$(basename "$game_dir") | |
| echo "### $game_name" >> release-body.md | |
| echo "" >> release-body.md | |
| # Check for each platform | |
| windows_file=$(find "$game_dir" -name "*Windows.exe" | head -1) | |
| macos_file=$(find "$game_dir" -name "*macOS.dmg" | head -1) | |
| linux_file=$(find "$game_dir" -name "*Linux.AppImage.tar" | head -1) | |
| if [ -n "$windows_file" ]; then | |
| filename=$(basename "$windows_file") | |
| echo "- **Windows**: [\`$filename\`]($BASE_URL/$filename)" >> release-body.md | |
| fi | |
| if [ -n "$macos_file" ]; then | |
| filename=$(basename "$macos_file") | |
| echo "- **macOS**: [\`$filename\`]($BASE_URL/$filename)" >> release-body.md | |
| fi | |
| if [ -n "$linux_file" ]; then | |
| filename=$(basename "$linux_file") | |
| echo "- **Linux**: [\`$filename\`]($BASE_URL/$filename)" >> release-body.md | |
| fi | |
| echo "" >> release-body.md | |
| fi | |
| done | |
| fi | |
| # Add installation instructions | |
| cat >> release-body.md << 'EOF' | |
| ## Installation Instructions | |
| ### Windows | |
| 1. Download the `.exe` file for your game | |
| 2. Run MudletInstaller - it'll download & install Mudlet for you | |
| 3. You can delete MudletInstaller after - Mudlet is all set up to play your favourite game. | |
| ### macOS | |
| 1. Download the `.dmg` file for your game | |
| 2. Open the DMG file | |
| 3. Run the MudletInstaller app from within the mounted DMG | |
| ### Linux | |
| 1. Download the `.AppImage.tar` file for your game | |
| 2. Extract it: `tar -xf MudletInstaller-[game]-Linux.AppImage.tar` | |
| 2. Extract and run the AppImage within: `MudletInstaller-[game].AppImage` | |
| 3. You can delete MudletInstaller after - Mudlet is all set up to play your favourite | |
| EOF | |
| echo "Generated release body:" | |
| cat release-body.md | |
| - name: Create Release with Game Organization | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: organized-releases/**/* | |
| tag_name: ${{ github.ref_name }} | |
| name: MudletInstaller ${{ github.ref_name }} | |
| body_path: release-body.md | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |