GitHub Actions Pynsist NSIS YAML

418 Views Asked by At

I am trying to create a GitHub action that will use Pynsist (a python package together with NSIS) to produce a build folder with the setup file my project on my github repository. I wondered if anyone has a working example of a YAML script that can be executed using github actions to essentially carry out the following:

  1. Installs NSIS onto the GitHub runner machine (not sure if this should be done on GitHub Ubuntu or Windows, or in conjunction with docker).
  2. Installs python 3.7.
  3. Installs pynsist and the other python dependencies
  4. Runs a python script which generates the installer.cfg file and then calls pynsist to execute the installer.cfg.
  5. Additional Extra... use 7zip to create a self extracting zip of the NSIS build folder using the following example (https://stackoverflow.com/a/30896241/12446456)

Any advice much appreciated. Thanks in advance.

1

There are 1 best solutions below

0
On

Example file below which I managed to use to complete this task.

on:
  pull_request:
    types: [closed]
    branches: [master]
  
name: Create Release with merge file

jobs:
  build:
    runs-on: windows-latest
    if: github.event.pull_request.merged == true
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - name: Set up Python 3.7.9
        uses: actions/setup-python@v1
        with:
          python-version: 3.7.9
          architecture: 'x64'
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install pynsist==2.5
          pip install six==1.14.0
          pip install retrying==1.3.3
          pip install numpy==1.18.1
          pip install requests==2.22.0
          pip install urllib3==1.25.8
          pip install chardet==3.0.4
          pip install certifi==2019.11.28
          pip install idna==2.8
      - name: Install 7Zip
        run: |
          choco install 7zip
      - name: Run the build script
        run: |
          python App001_Build.py