diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..28742d6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,74 @@ +name: Build and publish release installers + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + build: + name: Build ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + artifact: windows + - os: macos-latest + artifact: macos + - os: ubuntu-latest + artifact: linux + + steps: + - name: Check out source and submodules + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install Inno Setup + if: runner.os == 'Windows' + shell: powershell + run: choco install innosetup --no-progress --yes + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install pyinstaller + + - name: Build installer + run: python packager.py + + - name: Upload installer + uses: actions/upload-artifact@v4 + with: + name: installer-${{ matrix.artifact }} + path: packaging/artifacts/* + if-no-files-found: error + + release: + name: Publish GitHub Release + needs: build + runs-on: ubuntu-latest + steps: + - name: Download installers + uses: actions/download-artifact@v4 + with: + pattern: installer-* + path: release-assets + merge-multiple: true + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + files: release-assets/* diff --git a/packager.py b/packager.py index 99bf90a..c7d89bc 100644 --- a/packager.py +++ b/packager.py @@ -164,7 +164,7 @@ def build(*, clean: bool, runtime_dir: Path | None = None, gpu: bool = False) -> f'Source: "{bundle}\\*"; DestDir: "{{app}}"; Flags: recursesubdirs ignoreversion', *( [f'Source: "{icon_path}"; DestDir: "{{app}}"; Flags: ignoreversion'] if icon_path else [] ), "[Icons]", - *( ['Name: "{autoprograms}\\drunkenBot-IDE\\DrunkenBot-LLM-IDE"; Filename: "{app}\\DrunkenBot-LLM-IDE.exe"; IconFilename: "{app}\\drunken_bot_logo_small.ico"'] if icon_path else [] ), + *( [f'Name: "{{autoprograms}}\\{APP_NAME}\\{APP_NAME}"; Filename: "{{app}}\\{APP_NAME}.exe"; IconFilename: "{{app}}\\drunken_bot_logo_small.ico"'] if icon_path else [] ), *( [f'Name: "{{commondesktop}}\\{APP_NAME}"; Filename: "{{app}}\\{APP_NAME}.exe"; IconFilename: "{{app}}\\drunken_bot_logo_small.ico"'] if icon_path else [] ), "[Run]", 'Filename: "{app}\\runtime\\Scripts\\python.exe"; Parameters: """{app}\\runtime_setup.py"" --ensure"; WorkingDir: "{app}"; Flags: waituntilterminated; StatusMsg: "Installing hardware runtime. See runtime_setup.log for details..."',