diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 0712de47..c6cdfa08 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -34,6 +34,7 @@ jobs: run: | go build -trimpath -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/version.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/v2/version.date=`date -u +%FT%TZ`" -o sftpgo cd tests/eventsearcher + go mod tidy go build -trimpath -ldflags "-s -w" -o eventsearcher cd - @@ -46,8 +47,15 @@ jobs: run: | $GIT_COMMIT = (git describe --always --dirty) | Out-String $DATE_TIME = ([datetime]::Now.ToUniversalTime().toString("yyyy-MM-ddTHH:mm:ssZ")) | Out-String + $LATEST_TAG = ((git describe --tags $(git rev-list --tags --max-count=1)) | Out-String).Trim() + $REV_LIST=$LATEST_TAG+"..HEAD" + $COMMITS_FROM_TAG= ((git rev-list $REV_LIST --count) | Out-String).Trim() + $FILE_VERSION = $LATEST_TAG.substring(1) + "." + $COMMITS_FROM_TAG + go install github.com/tc-hib/go-winres@latest + go-winres simply --arch amd64 --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 sftpgo.exe cd tests/eventsearcher + go mod tidy go build -trimpath -ldflags "-s -w" -o eventsearcher.exe cd ../.. @@ -114,6 +122,32 @@ jobs: name: sftpgo-${{ matrix.os }}-go-${{ matrix.go }} path: output + - name: Prepare Windows installer + if: startsWith(matrix.os, 'windows-') + run: | + Remove-Item -LiteralPath "output" -Force -Recurse -ErrorAction Ignore + mkdir output + copy .\sftpgo.exe .\output + copy .\sftpgo.json .\output + copy .\sftpgo.db .\output + copy .\LICENSE .\output\LICENSE.txt + mkdir output\templates + xcopy .\templates .\output\templates\ /E + mkdir output\static + xcopy .\static .\output\static\ /E + $LATEST_TAG = ((git describe --tags $(git rev-list --tags --max-count=1)) | Out-String).Trim() + $REV_LIST=$LATEST_TAG+"..HEAD" + $COMMITS_FROM_TAG= ((git rev-list $REV_LIST --count) | Out-String).Trim() + $Env:SFTPGO_ISS_DEV_VERSION = $LATEST_TAG + "." + $COMMITS_FROM_TAG + iscc windows-installer\sftpgo.iss + + - name: Upload Windows installer artifact + if: startsWith(matrix.os, 'windows-') + uses: actions/upload-artifact@v2 + with: + name: sftpgo_windows_installer_x86_64 + path: ./sftpgo_windows_x86_64.exe + test-goarch-386: name: Run test cases on 32-bit arch runs-on: ubuntu-latest @@ -129,6 +163,7 @@ jobs: - name: Build run: | cd tests/eventsearcher + go mod tidy go build -trimpath -ldflags "-s -w" -o eventsearcher cd - env: @@ -185,6 +220,7 @@ jobs: - name: Build run: | cd tests/eventsearcher + go mod tidy go build -trimpath -ldflags "-s -w" -o eventsearcher cd - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea2afd8f..fd4fa699 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,12 @@ jobs: run: | $GIT_COMMIT = (git describe --always --dirty) | Out-String $DATE_TIME = ([datetime]::Now.ToUniversalTime().toString("yyyy-MM-ddTHH:mm:ssZ")) | Out-String + $FILE_VERSION = $Env:SFTPGO_VERSION.substring(1) + ".0" + go install github.com/tc-hib/go-winres@latest + go-winres simply --arch amd64 --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 sftpgo.exe + env: + SFTPGO_VERSION: ${{ steps.get_version.outputs.VERSION }} - name: Initialize data provider run: ./sftpgo initprovider diff --git a/docs/howto/img/logo.png b/docs/howto/img/logo.png index 204695bb..0c320ff7 100644 Binary files a/docs/howto/img/logo.png and b/docs/howto/img/logo.png differ diff --git a/go.mod b/go.mod index ac982bcc..e83b94ae 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( go.uber.org/automaxprocs v1.4.0 gocloud.dev v0.24.0 golang.org/x/crypto v0.0.0-20210915214749-c084706c2272 - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f + golang.org/x/net v0.0.0-20211020060615-d418f374d309 golang.org/x/sys v0.0.0-20211023085530-d6a326fbbf70 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac google.golang.org/api v0.59.0 @@ -132,5 +132,5 @@ replace ( github.com/eikenb/pipeat => github.com/drakkan/pipeat v0.0.0-20210805162858-70e57fa8a639 github.com/jlaffaye/ftp => github.com/drakkan/ftp v0.0.0-20201114075148-9b9adce499a9 golang.org/x/crypto => github.com/drakkan/crypto v0.0.0-20210918082254-e7eb8487714b - golang.org/x/net => github.com/drakkan/net v0.0.0-20211016145912-4e917b39e717 + golang.org/x/net => github.com/drakkan/net v0.0.0-20211023135414-8d45d13382c8 ) diff --git a/go.sum b/go.sum index 44b682fa..75be7cd6 100644 --- a/go.sum +++ b/go.sum @@ -215,8 +215,8 @@ github.com/drakkan/crypto v0.0.0-20210918082254-e7eb8487714b h1:MZY6RAQFVhJous68 github.com/drakkan/crypto v0.0.0-20210918082254-e7eb8487714b/go.mod h1:0hNoheD1tVu/m8WMkw/chBXf5VpwzL5fHQU25k79NKo= github.com/drakkan/ftp v0.0.0-20201114075148-9b9adce499a9 h1:LPH1dEblAOO/LoG7yHPMtBLXhQmjaga91/DDjWk9jWA= github.com/drakkan/ftp v0.0.0-20201114075148-9b9adce499a9/go.mod h1:2lmrmq866uF2tnje75wQHzmPXhmSWUt7Gyx2vgK1RCU= -github.com/drakkan/net v0.0.0-20211016145912-4e917b39e717 h1:YShsCetg9md5wI7rCeCQXEl4CHkdv1HAk43MRZoNZWM= -github.com/drakkan/net v0.0.0-20211016145912-4e917b39e717/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +github.com/drakkan/net v0.0.0-20211023135414-8d45d13382c8 h1:xjuGl7Do3QtkkIaEOHME5EAG/dSi03ahxuqkmh9tx9A= +github.com/drakkan/net v0.0.0-20211023135414-8d45d13382c8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= github.com/drakkan/pipeat v0.0.0-20210805162858-70e57fa8a639 h1:8tfGdb4kg/YCvAbIrsMazgoNtnqdOqQVDKW12uUCuuU= github.com/drakkan/pipeat v0.0.0-20210805162858-70e57fa8a639/go.mod h1:kltMsfRMTHSFdMbK66XdS8mfMW77+FZA1fGY1xYMF84= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= diff --git a/static/favicon.ico b/static/favicon.ico index 43773ef1..f7bbf378 100644 Binary files a/static/favicon.ico and b/static/favicon.ico differ diff --git a/tests/eventsearcher/go.mod b/tests/eventsearcher/go.mod index 927e455e..a66c3142 100644 --- a/tests/eventsearcher/go.mod +++ b/tests/eventsearcher/go.mod @@ -16,7 +16,7 @@ require ( github.com/mattn/go-isatty v0.0.14 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/oklog/run v1.1.0 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/net v0.0.0-20211020060615-d418f374d309 // indirect golang.org/x/sys v0.0.0-20211023085530-d6a326fbbf70 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20211021150943-2b146023228c // indirect diff --git a/tests/eventsearcher/go.sum b/tests/eventsearcher/go.sum index c1ec4b7f..84fadbd5 100644 --- a/tests/eventsearcher/go.sum +++ b/tests/eventsearcher/go.sum @@ -809,8 +809,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211020060615-d418f374d309 h1:A0lJIi+hcTR6aajJH4YqKWwohY4aW9RO7oRMcdv+HKI= +golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/windows-installer/icon.ico b/windows-installer/icon.ico new file mode 100644 index 00000000..89a95137 Binary files /dev/null and b/windows-installer/icon.ico differ diff --git a/windows-installer/sftpgo.iss b/windows-installer/sftpgo.iss index c784a373..3ef546bc 100644 --- a/windows-installer/sftpgo.iss +++ b/windows-installer/sftpgo.iss @@ -2,7 +2,7 @@ #if GetEnv("SFTPGO_ISS_VERSION") != "" #define MyAppVersion GetEnv("SFTPGO_ISS_VERSION") #else - #define MyAppVersion "v0.0.0" + #define MyAppVersion GetEnv("SFTPGO_ISS_DEV_VERSION") #endif #define MyAppURL "https://github.com/drakkan/sftpgo" #define MyVersionInfo StringChange(MyAppVersion,"v","") @@ -23,18 +23,22 @@ AppVerName={#MyAppName} {#MyAppVersion} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} +AppCopyright=AGPL-3.0 DefaultDirName={autopf}\{#MyAppName} DefaultGroupName={#MyAppName} LicenseFile={#MyAppDir}\LICENSE.txt OutputDir={#MyOutputDir} OutputBaseFilename=sftpgo_windows_x86_64 +SetupIconFile=icon.ico SolidCompression=yes +UninstallDisplayIcon={app}\sftpgo.exe WizardStyle=modern ArchitecturesInstallIn64BitMode=x64 PrivilegesRequired=admin ArchitecturesAllowed=x64 -MinVersion=6.1 +MinVersion=6.1sp1 VersionInfoVersion={#MyVersionInfo} +VersionInfoCopyright=AGPL-3.0 [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" @@ -68,6 +72,6 @@ Filename: "{app}\{#MyAppExeName}"; Parameters: "service install -c ""{commonappd Filename: "{app}\{#MyAppExeName}"; Parameters: "service start"; Description: "Start SFTPGo Windows Service"; Flags: runhidden [UninstallRun] -Filename: "{app}\{#MyAppExeName}"; Parameters: "service stop"; Flags: runhidden -Filename: "{app}\{#MyAppExeName}"; Parameters: "service uninstall"; Flags: runhidden -Filename: "netsh"; Parameters: "advfirewall firewall delete rule name=""SFTPGo Service"""; Flags: runhidden +Filename: "{app}\{#MyAppExeName}"; Parameters: "service stop"; Flags: runhidden; RunOnceId: "Stop SFTPGo service" +Filename: "{app}\{#MyAppExeName}"; Parameters: "service uninstall"; Flags: runhidden; RunOnceId: "Uninstall SFTPGo service" +Filename: "netsh"; Parameters: "advfirewall firewall delete rule name=""SFTPGo Service"""; Flags: runhidden; RunOnceId: "Remove SFTPGo firewall rule" \ No newline at end of file