build(packaging): add macOS DMG & Windows NSIS with strict artifacts … #1
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: Windows Installer | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - "src/**" | |
| - "scripts/build-and-package-windows.ps1" | |
| - "packaging/windows/nsis/**" | |
| - "ecli.spec" | |
| - "pyproject.toml" | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| architecture: "x64" | |
| - name: Install NSIS | |
| run: choco install nsis -y | |
| - name: Build Installer | |
| shell: pwsh | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pyinstaller aiohttp aiosignal yarl multidict frozenlist python-dotenv toml chardet pyperclip wcwidth pygments tato PyYAML | |
| ./scripts/build-and-package-windows.ps1 | |
| - name: Read version | |
| id: ver | |
| shell: bash | |
| run: | | |
| VER=$(awk -F'"' '/^[[:space:]]*version[[:space:]]*=/ {print $2; exit}' pyproject.toml) | |
| echo "version=$VER" >> "$GITHUB_OUTPUT" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-installer | |
| path: | | |
| releases/${{ steps.ver.outputs.version }}/ecli_${{ steps.ver.outputs.version }}_win_x64.exe | |
| releases/${{ steps.ver.outputs.version }}/ecli_${{ steps.ver.outputs.version }}_win_x64.exe.sha256 |