octoprint_release #157
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 Installer | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
repository_dispatch: | |
types: [octoprint_release] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: π Get OctoPrint Version | |
id: octoprint_version | |
uses: pozetroninc/github-action-get-latest-release@master | |
with: | |
repository: OctoPrint/OctoPrint | |
excludes: draft | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
- name: π¨ Install OctoPrint into WinPython | |
run: | | |
WPy64-31050\Scripts\python.bat -m pip install OctoPrint==${{ steps.octoprint_version.outputs.release }} | |
shell: cmd | |
- name: π¨ Build Installer | |
run: | | |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" /DOctoPrintVersion="${{ steps.octoprint_version.outputs.release }}" "OctoPrint Setup.iss" | |
shell: cmd | |
- name: π¨ Generate CA | |
id: write_file | |
uses: timheuer/base64-to-file@v1.2 | |
with: | |
fileName: 'OctoPrintCA.crt' | |
encodedString: ${{ secrets.OCTOPRINT_CA }} | |
- name: π Import CA | |
run: | | |
certutil -addstore "Root" "${{ steps.write_file.outputs.filePath }}" | |
shell: cmd | |
- name: βοΈ Sign Installer | |
uses: jneilliii/signtool-code-sign@main | |
with: | |
certificate: '${{ secrets.CERTIFICATE }}' | |
cert-password: '${{ secrets.PASSWORD }}' | |
cert-sha1: '${{ secrets.CERTHASH }}' | |
cert-description: 'OctoPrint Installer by jneilliii' | |
folder: 'Output' | |
recursive: false | |
timestamp-server: 'http://timestamp.digicert.com' | |
debug: true | |
- name: π§Ή Delete Existing Release and Tag | |
uses: ClementTsang/delete-tag-and-release@v0.4.0 | |
with: | |
delete_release: true | |
tag_name: ${{ steps.octoprint_version.outputs.release }} # tag name to delete | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: π Create Release and Attach Assets | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: "OctoPrint ${{ steps.octoprint_version.outputs.release }} Setup for Windows" | |
tag_name: "${{ steps.octoprint_version.outputs.release }}" | |
body: "OctoPrint Setup created with Inno Setup using WinPython, winsw, and GitHub Actions." | |
fail_on_unmatched_files: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
Output/OctoPrint Setup ${{ steps.octoprint_version.outputs.release }}.exe |