diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 2a826d54..e6be2100 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -64,6 +64,10 @@ jobs: $Env:GOARCH='arm64' go-winres simply --arch arm64 --product-version $LATEST_TAG-dev-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo server" --product-name SFTPGo --copyright "AGPL-3.0" --original-filename sftpgo.exe --icon .\windows-installer\icon.ico go build -trimpath -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/version.commit=$GIT_COMMIT -X github.com/drakkan/sftpgo/v2/version.date=$DATE_TIME" -o .\arm64\sftpgo.exe + mkdir x86 + $Env:GOARCH='386' + go-winres simply --arch 386 --product-version $LATEST_TAG-dev-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo server" --product-name SFTPGo --copyright "AGPL-3.0" --original-filename sftpgo.exe --icon .\windows-installer\icon.ico + go build -trimpath -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/version.commit=$GIT_COMMIT -X github.com/drakkan/sftpgo/v2/version.date=$DATE_TIME" -o .\x86\sftpgo.exe Remove-Item Env:\CGO_ENABLED Remove-Item Env:\GOOS Remove-Item Env:\GOARCH @@ -139,6 +143,7 @@ jobs: rm "$CERT_PATH" & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /sm /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n "Nicola Murino" /d "SFTPGo" .\sftpgo.exe & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /sm /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n "Nicola Murino" /d "SFTPGo" .\arm64\sftpgo.exe + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /sm /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n "Nicola Murino" /d "SFTPGo" .\x86\sftpgo.exe $INNO_S='/Ssigntool=$qC:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe$q sign /sm /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n $qNicola Murino$q /d $qSFTPGo$q $f' iscc "$INNO_S" .\windows-installer\sftpgo.iss @@ -153,6 +158,11 @@ jobs: Remove-Item Env:\SFTPGO_DATA_PROVIDER__NAME $Env:SFTPGO_ISS_ARCH='arm64' iscc "$INNO_S" .\windows-installer\sftpgo.iss + + rm .\output\sftpgo.exe + copy .\x86\sftpgo.exe .\output + $Env:SFTPGO_ISS_ARCH='x86' + iscc "$INNO_S" .\windows-installer\sftpgo.iss certutil -delstore MY "Nicola Murino" env: CERT_DATA: ${{ secrets.CERT_DATA }} @@ -172,6 +182,13 @@ jobs: name: sftpgo_windows_installer_arm64 path: ./sftpgo_windows_arm64.exe + - name: Upload Windows installer x86 artifact + if: ${{ startsWith(matrix.os, 'windows-') && github.event_name != 'pull_request' }} + uses: actions/upload-artifact@v2 + with: + name: sftpgo_windows_installer_x86 + path: ./sftpgo_windows_x86.exe + - name: Prepare build artifact for Windows if: startsWith(matrix.os, 'windows-') run: | @@ -180,6 +197,8 @@ jobs: copy .\sftpgo.exe .\output mkdir output\arm64 copy .\arm64\sftpgo.exe .\output\arm64 + mkdir output\x86 + copy .\x86\sftpgo.exe .\output\x86 copy .\sftpgo.json .\output (Get-Content .\output\sftpgo.json).replace('"sqlite"', '"bolt"') | Set-Content .\output\sftpgo.json mkdir output\templates diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 438426b2..3578724a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,6 +92,10 @@ jobs: $Env:GOARCH='arm64' go-winres simply --arch arm64 --product-version $Env:SFTPGO_VERSION-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo server" --product-name SFTPGo --copyright "AGPL-3.0" --original-filename sftpgo.exe --icon .\windows-installer\icon.ico go build -trimpath -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/version.commit=$GIT_COMMIT -X github.com/drakkan/sftpgo/v2/version.date=$DATE_TIME" -o .\arm64\sftpgo.exe + mkdir x86 + $Env:GOARCH='386' + go-winres simply --arch 386 --product-version $Env:SFTPGO_VERSION-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo server" --product-name SFTPGo --copyright "AGPL-3.0" --original-filename sftpgo.exe --icon .\windows-installer\icon.ico + go build -trimpath -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/version.commit=$GIT_COMMIT -X github.com/drakkan/sftpgo/v2/version.date=$DATE_TIME" -o .\x86\sftpgo.exe Remove-Item Env:\CGO_ENABLED Remove-Item Env:\GOOS Remove-Item Env:\GOARCH @@ -152,6 +156,7 @@ jobs: rm "$CERT_PATH" & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /sm /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n "Nicola Murino" /d "SFTPGo" .\sftpgo.exe & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /sm /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n "Nicola Murino" /d "SFTPGo" .\arm64\sftpgo.exe + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /sm /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n "Nicola Murino" /d "SFTPGo" .\x86\sftpgo.exe $INNO_S='/Ssigntool=$qC:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe$q sign /sm /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n $qNicola Murino$q /d $qSFTPGo$q $f' iscc "$INNO_S" .\windows-installer\sftpgo.iss @@ -166,6 +171,11 @@ jobs: Remove-Item Env:\SFTPGO_DATA_PROVIDER__NAME $Env:SFTPGO_ISS_ARCH='arm64' iscc "$INNO_S" .\windows-installer\sftpgo.iss + + rm .\output\sftpgo.exe + copy .\x86\sftpgo.exe .\output + $Env:SFTPGO_ISS_ARCH='x86' + iscc "$INNO_S" .\windows-installer\sftpgo.iss certutil -delstore MY "Nicola Murino" env: SFTPGO_ISS_VERSION: ${{ steps.get_version.outputs.VERSION }} @@ -179,7 +189,9 @@ jobs: mkdir win-portable copy .\sftpgo.exe .\win-portable mkdir win-portable\arm64 - copy .\arm64\sftpgo.exe .\win-portable\arm64\sftpgo.exe + copy .\arm64\sftpgo.exe .\win-portable\arm64 + mkdir win-portable\x86 + copy .\x86\sftpgo.exe .\win-portable\x86 copy .\sftpgo.json .\win-portable (Get-Content .\win-portable\sftpgo.json).replace('"sqlite"', '"bolt"') | Set-Content .\win-portable\sftpgo.json copy .\output\sftpgo.db .\win-portable @@ -224,6 +236,14 @@ jobs: path: ./sftpgo_windows_arm64.exe retention-days: 1 + - name: Upload Windows installer x86 artifact + if: startsWith(matrix.os, 'windows-') + uses: actions/upload-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.VERSION }}_${{ steps.get_os_name.outputs.OS }}_x86.exe + path: ./sftpgo_windows_x86.exe + retention-days: 1 + - name: Upload Windows portable artifact if: startsWith(matrix.os, 'windows-') uses: actions/upload-artifact@v2 @@ -542,6 +562,11 @@ jobs: with: name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_windows_arm64.exe + - name: Download Windows installer x86 artifact + uses: actions/download-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_windows_x86.exe + - name: Download Windows portable artifact uses: actions/download-artifact@v2 with: @@ -556,6 +581,7 @@ jobs: run: | mv sftpgo_windows_x86_64.exe sftpgo_${SFTPGO_VERSION}_windows_x86_64.exe mv sftpgo_windows_arm64.exe sftpgo_${SFTPGO_VERSION}_windows_arm64.exe + mv sftpgo_windows_x86.exe sftpgo_${SFTPGO_VERSION}_windows_x86.exe mv sftpgo_portable.zip sftpgo_${SFTPGO_VERSION}_windows_portable.zip gh release create "${SFTPGO_VERSION}" -t "${SFTPGO_VERSION}" gh release upload "${SFTPGO_VERSION}" sftpgo_*.xz --clobber diff --git a/pkgs/build.sh b/pkgs/build.sh index 00a604f5..a0d8828d 100755 --- a/pkgs/build.sh +++ b/pkgs/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -NFPM_VERSION=2.9.2 +NFPM_VERSION=2.10.0 NFPM_ARCH=${NFPM_ARCH:-amd64} if [ -z ${SFTPGO_VERSION} ] then diff --git a/windows-installer/sftpgo.iss b/windows-installer/sftpgo.iss index 344213ce..8b25eb9f 100644 --- a/windows-installer/sftpgo.iss +++ b/windows-installer/sftpgo.iss @@ -7,8 +7,14 @@ #if GetEnv("SFTPGO_ISS_ARCH") != "" #define MyAppArch GetEnv("SFTPGO_ISS_ARCH") #define MySetupName "sftpgo_windows_" + MyAppArch + #if MyAppArch == "x86" + #define MyAppArch64 "" + #else + #define MyAppArch64 GetEnv("SFTPGO_ISS_ARCH") + #endif #else #define MyAppArch "x64" + #define MyAppArch64 "x64" #define MySetupName "sftpgo_windows_x86_64" #endif #define MyAppURL "https://github.com/drakkan/sftpgo" @@ -41,7 +47,7 @@ SetupIconFile=icon.ico SolidCompression=yes UninstallDisplayIcon={app}\sftpgo.exe WizardStyle=modern -ArchitecturesInstallIn64BitMode={#MyAppArch} +ArchitecturesInstallIn64BitMode={#MyAppArch64} PrivilegesRequired=admin ArchitecturesAllowed={#MyAppArch} MinVersion=6.1sp1