Skip to content

Publish to Release

Publish to Release #32

name: Publish to Release
on:
release:
types: [published]
jobs:
build_msi:
runs-on: self-hosted
permissions:
contents: write
strategy:
matrix:
python-version: [3.11]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m venv .venv
.venv/Scripts/Activate.ps1
pip install pipenv==2023.5.19 setuptools wheel
pipenv install -d --skip-lock --system
- name: Build exe
shell: pwsh
run: |
python setup.py build
mkdir files-to-sign
mv build/exe.win-amd64-${{ matrix.python-version }}/nifcloud.exe files-to-sign
- name: Sign nifcloud.exe
shell: pwsh
run: |
signtool sign /f "${{ secrets.CERTIFICATE_FILE }}" /csp "${{ secrets.CSP_NAME }}" /k "${{ secrets.HARDWARE_TOKEN_KEYS }}" /fd SHA256 /td SHA256 /tr "http://timestamp.digicert.com" "files-to-sign/nifcloud.exe"
- name: Create MSI installer
shell: pwsh
run: |
mv files-to-sign/nifcloud.exe build/exe.win-amd64-${{ matrix.python-version }}/
python setup.py bdist_msi
- name: Sign MSI installer
shell: pwsh
run: |
signtool sign /f "${{ secrets.CERTIFICATE_FILE }}" /csp "${{ secrets.CSP_NAME }}" /k "${{ secrets.HARDWARE_TOKEN_KEYS }}" /fd SHA256 /td SHA256 /tr "http://timestamp.digicert.com" "dist/*.msi"
- name: Upload to release asset
uses: softprops/action-gh-release@v1
with:
files: |
dist/nifcloud-cli-*-win64.msi