Skip to content

Commit 4b385c2

Browse files
Add GitHub Actions workflow for automated MSI generation
1 parent d3e43cc commit 4b385c2

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/build-msi.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and Release MSI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [closed]
9+
branches:
10+
- master
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
build:
17+
name: Build MSI Installer
18+
runs-on: windows-latest
19+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
20+
21+
steps:
22+
- name: Checkout Code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: '8.0.x'
29+
30+
- name: Add msbuild to PATH
31+
uses: microsoft/setup-msbuild@v2
32+
33+
- name: Build MSI Installer
34+
shell: pwsh
35+
run: |
36+
.\Build.ps1 -Setup
37+
38+
- name: Upload MSI Artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: ScriptProSetup-MSI
42+
path: Release\ScriptProSetup.msi
43+
44+
- name: Create GitHub Release
45+
uses: softprops/action-gh-release@v2
46+
if: github.event_name == 'push'
47+
with:
48+
files: Release\ScriptProSetup.msi
49+
tag_name: "v${{ github.run_number }}.0.0" # Auto-generate a version or configure it based on commit
50+
name: "Latest Master Build (${{ github.run_number }})"
51+
body: "Automated release of ScriptProPlus installer."
52+
draft: true
53+
prerelease: true
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)