Build Windows Installer #35
Workflow file for this run
This file contains 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: | |
tags: | |
- 'v*' | |
branches: | |
- main | |
- githubactions | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12.6' # Specify your Python version here | |
- name: Install NSIS | |
run: choco install nsis | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Build pyperclip wheel | |
run: | | |
mkdir whl | |
pip wheel --wheel-dir=whl pyperclip | |
- name: Install pynsist | |
run: pip install pynsist | |
- name: Set Build Version | |
id: ver | |
run: | | |
$env:VERSION=$(git describe --tags --always --dirty) | |
sed -i -e "s/@VERSION@/$VERSION/g" installer.cfg | |
sed -i -e "s/@VERSION@/$VERSION/g" pyspy/VERSION | |
echo "VERSION=$env:VERSION" | |
cat pyspy/VERSION | |
cat installer.cfg | |
- name: Run pynsist | |
run: | | |
pynsist installer.cfg | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PySpy-Installer | |
path: build/*.exe | |
- name: Release | |
uses: softprops/action-gh-release@v2.2.1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
# Identify if this is a pre release by checking if the tag name contains -rc, -b, -a | |
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }} | |
files: build/*.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |