feat: add windows installer #10
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 Windows Installer | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build-windows-installer: | |
| name: Build Windows Installer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.3 | |
| with: | |
| pixi-version: v0.59.0 | |
| cache: true | |
| cache-write: false | |
| - name: Download pixi executable for Windows | |
| run: | | |
| cd utils/windows-installer | |
| curl -L https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-pc-windows-msvc.exe -o pixi.exe | |
| - name: Get version from git | |
| id: get_version | |
| run: | | |
| # Try to get version from git tag, fallback to commit hash | |
| VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "0.0.0-dev") | |
| # Remove 'v' prefix if present | |
| VERSION=${VERSION#v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Building installer version: $VERSION" | |
| - name: Build Windows installer | |
| run: | | |
| cd utils/windows-installer | |
| pixi exec --spec nsis makensis -DPRODUCT_VERSION=${{ steps.get_version.outputs.version }} pixi_installer.nsi | |
| ls -lh open-tyndp-*.exe | |
| - name: Generate checksum | |
| run: | | |
| cd utils/windows-installer | |
| sha256sum open-tyndp-*.exe > checksums.txt | |
| cat checksums.txt | |
| - name: Upload installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-installer | |
| path: | | |
| utils/windows-installer/open-tyndp-*.exe | |
| utils/windows-installer/checksums.txt | |
| - name: Comment on PR | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const checksums = fs.readFileSync('utils/windows-installer/checksums.txt', 'utf8'); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `## 🪟 Windows Installer Built Successfully | |
| The Windows installer has been built and is available as an artifact in this workflow run. | |
| **Download:** [windows-installer](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) | |
| **SHA256 Checksums:** | |
| \`\`\` | |
| ${checksums} | |
| \`\`\` | |
| The installer includes: | |
| - Pixi executable (~20 MB) | |
| - Automatic repository cloning | |
| - Environment installation on-demand | |
| - PowerShell and CMD shortcuts | |
| - Official Open Energy Transition branding` | |
| }) |