-
Notifications
You must be signed in to change notification settings - Fork 21
76 lines (65 loc) · 2.39 KB
/
build_windows_installer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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
run: gh release delete ${{ steps.octoprint_version.outputs.release }} --cleanup-tag
continue-on-error: true
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