Skip to content

Build Windows Installer #20

Build Windows Installer

Build Windows Installer #20

Workflow file for this run

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@v2
- name: Set up Python
uses: actions/setup-python@v2
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: Determine Build Version
run: |
echo "VERSION=$(git describe --tags --always --dirty)" >> $GITHUB_ENV
- name: Update version
run: |
echo $VERSION > VERSION
sed -i -e "s/@VERSION@/${{ env.VERSION }}/g" 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 }}