Skip to content

Instantly share code, notes, and snippets.

@TheOrioli
Last active September 8, 2021 12:37
Show Gist options
  • Save TheOrioli/b9355a5ed4159bfbd340de474e4fa455 to your computer and use it in GitHub Desktop.
Save TheOrioli/b9355a5ed4159bfbd340de474e4fa455 to your computer and use it in GitHub Desktop.
PowerShell script that can be used in a GitHub Action to change the icon of an executable, useful in Godot Engine CI scripts
$exePath = $args[0]
$iconPath = $args[1]
Invoke-WebRequest -Uri "https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe" -OutFile ".\rcedit-x64.exe"
.\rcedit-x64.exe $exePath --set-icon $iconPath
Remove-Item .\rcedit-x64.exe
@TheOrioli
Copy link
Author

Example usage in GitHub Actions

place this job after your build job, or if you're building on windows, you can place the run step with id set_icon immediately there

  update_icon:
    runs-on: windows-2019
    name: Update Windows Icon
    needs: [build]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          lfs: true
      - uses: actions/[email protected]
        with:
          name: windows
          path: build/windows
      - id: set_icon
        run: .ci\update_windows_icon.ps1 .\build\windows\game.exe .\game\assets\art\game_icon\icon.ico
      - uses: actions/[email protected]
        with:
          name: windows
          path: build/windows
          retention-days: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment