diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abb7797..1a20a67 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,29 @@ permissions: contents: read jobs: + windows-build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + - run: go build -o ipingtray.exe + + - name: Set up NSIS + run: choco install nsis + + - name: Create installer + run: | + cp build/windows/installer.nsi . + & "C:\Program Files (x86)\NSIS\makensis.exe" "installer.nsi" + + - name: Upload installer + uses: actions/upload-artifact@v2 + with: + name: iPingTray-setup.exe + path: iPingTray-setup.exe + macos-build: runs-on: macos-13 steps: @@ -47,6 +70,7 @@ jobs: pull-requests: write needs: - macos-build + - windows-build runs-on: ubuntu-latest steps: - name: Checkout diff --git a/build/windows/installer.nsi b/build/windows/installer.nsi new file mode 100644 index 0000000..0ae1cda --- /dev/null +++ b/build/windows/installer.nsi @@ -0,0 +1,23 @@ +Outfile "iPingTray-setup.exe" + +InstallDir "$PROGRAMFILES\iPingTray" + +RequestExecutionLevel admin + +Page directory +Page instfiles + +Section "Install" + SetOutPath $INSTDIR + + File /r "ipingtray.exe" + + CreateShortCut "$SMSTARTUP\iPingTray.lnk" "$INSTDIR\ipingtray.exe" + WriteUninstaller "$INSTDIR\uninstall.exe" +SectionEnd + +Section "Uninstall" + Delete "$INSTDIR\ipingtray.exe" + Delete "$SMSTARTUP\iPingTray.lnk" + RMDir /r "$INSTDIR" +SectionEnd