diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 43bc3c15..5b59c6c5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - feat/* tags: - v* @@ -13,7 +14,7 @@ jobs: continue-on-error: true strategy: matrix: - goos: [linux, darwin] + goos: [linux, darwin, windows] goarch: [amd64, arm64] steps: - uses: actions/checkout@v4 @@ -33,6 +34,10 @@ jobs: cd build if [[ $GOOS == 'darwin' ]]; then cp raiden raiden-macos-"$GOARCH" + elif [[ $GOOS == 'windows' ]]; then + mv raiden raiden.exe + sudo apt-get install -y nsis + makensis -NOCD -DARCH="$GOARCH" ${GITHUB_WORKSPACE}/scripts/windows.nsi else cp raiden raiden-"$GOOS"-"$GOARCH" fi diff --git a/scripts/windows.nsi b/scripts/windows.nsi new file mode 100644 index 00000000..939649ed --- /dev/null +++ b/scripts/windows.nsi @@ -0,0 +1,35 @@ +!include "MUI2.nsh" + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_LANGUAGE "English" + +!define NAME "Raiden" +!define APPFILE "raiden.exe" + +Name "${NAME}" +Outfile "raiden-windows-${ARCH}-setup.exe" +InstallDir $WINDIR +ShowInstDetails show +RequestExecutionLevel admin + +Section + SetOutPath $INSTDIR + File raiden.exe + + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Raiden" "DisplayName" "Raiden" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Raiden" "Publisher" "Refactory" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Raiden" "UninstallString" "$\"$INSTDIR\raiden-uninstall.exe$\"" + + WriteUninstaller $INSTDIR\raiden-uninstall.exe +SectionEnd + +Section "Uninstall" + Delete $INSTDIR\raiden.exe + Delete $INSTDIR\raiden-uninstall.exe + RMDir $INSTDIR + + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Raiden" +SectionEnd