diff --git a/.github/workflows/build-debug.yaml b/.github/workflows/build-debug.yaml new file mode 100644 index 0000000..f90fb1b --- /dev/null +++ b/.github/workflows/build-debug.yaml @@ -0,0 +1,33 @@ +name: build-debug + +on: + workflow_dispatch: + pull_request: + branches: dev-* + paths: + - '**.vb' + - '**.vbproj' + +jobs: + build-debug: + runs-on: windows-latest + steps: + - name: "Get Short SHA" + run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Checkout Code + uses: actions/checkout@v4 + + # msbuild cannot handle .vdproj Installer projects, so only build debug for now. + - name: Build solution + run: msbuild -t:build -restore -p:Configuration=Debug WinNUT_V2/WinNUT_V2.sln + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ format('WinNUT-Client-debugbuild-{0}', env.SHORT_SHA) }} + if-no-files-found: error + path: WinNUT_V2/WinNUT-Client/bin/Debug \ No newline at end of file diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml new file mode 100644 index 0000000..d833318 --- /dev/null +++ b/.github/workflows/build-release.yaml @@ -0,0 +1,99 @@ +# Build solution in Release mode and submit a GitHub release. + +name: build-release + +on: + push: + tags: "v*" + +env: + # The desired name of the no-install archive to be uploaded along side the installer. + ARCHIVE_NAME: "_WinNUT-Client-NoInstall" + +jobs: + build-release: + runs-on: windows-latest + steps: + - name: Setup Git + run: | + git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github + git config --global user.name github-actions + git config --global user.email github-actions@github.com + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Extract version from tag + id: get-ver + run: ./.github/workflows/get-ver.ps1 ${{ github.ref }} + + - name: Confirm Build mode + id: build-mode + run: > + if ($${{ steps.get-ver.outputs.ISPRERELEASE }}) + { echo "BUILD_MODE=PreRelease" >> $env:GITHUB_OUTPUT } + else { echo "BUILD_MODE=Release" >> $env:GITHUB_OUTPUT } + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Build solution + working-directory: WinNUT_V2 + run: > + msbuild -t:"publish" -restore + -p:Configuration="${{ steps.build-mode.outputs.BUILD_MODE }}" + -p:Version="${{ steps.get-ver.outputs.VER }}" + -p:ApplicationVersion="${{ steps.get-ver.outputs.VER }}.0" + -p:PublishDir="./publish" + + - name: Checkout pages branch + uses: actions/checkout@v4 + with: + ref: "gh-pages" + path: "gh-pages" + + - name: Prep ClickOnce branch and deploy + working-directory: gh-pages + run: | + $outDir = "WinNUT_V2/WinNUT-Client/publish" + Write-Output "Removing previous files..." + if (Test-Path "Application Files") { + Remove-Item -Path "Application Files" -Recurse + } + if (Test-Path "WinNUT-Client.application") { + Remove-Item -Path "WinNUT-Client.application" + } + Write-Output "Copying new files..." + Copy-Item -Path "../$outDir/Application Files","../$outDir/WinNUT-Client.application" -Destination . -Recurse + # Stage and commit. + Write-Output "Staging..." + git add -A + Write-Output "Committing..." + git commit -m "Update to ${{ env.SEMVER }}" + # Push. + git push + + - name: Prepare no install archive + run: | + $arc = Compress-Archive -PassThru -Path "WinNUT_V2\WinNUT-Client\bin\${{ steps.build-mode.outputs.BUILD_MODE }}" -DestinationPath "${{ env.ARCHIVE_NAME }}-${{ steps.get-ver.outputs.SEMVER }}.zip" + $arc = $arc -replace '\\','/' + echo "ARCHIVE_NAME=$arc" >> $env:GITHUB_ENV + + # Rename the CO bootstrapper file to appear after the MSI once it's uploaded. + - name: HACK - Rename ClickOnce bootstrapper + run: Rename-Item -Path "./WinNUT_V2/WinNUT-Client/publish/WinNUT-Client.application" -NewName "_WinNUT-Client-ClickOnce-Installer.application" + + - name: Create GitHub release + uses: softprops/action-gh-release@v2 + with: + draft: true + fail_on_unmatched_files: true + generate_release_notes: true + files: | + WinNUT_V2/WinNUT-Client/publish/_WinNUT-Client-ClickOnce-Installer.application + ${{ env.ARCHIVE_NAME }} + +# Leave out other files until we no longer need the MSI be first in the assets list. +# LICENSE.txt +# README.md +# CHANGELOG.md \ No newline at end of file diff --git a/.github/workflows/build-translation.yaml b/.github/workflows/build-translation.yaml new file mode 100644 index 0000000..e207796 --- /dev/null +++ b/.github/workflows/build-translation.yaml @@ -0,0 +1,25 @@ +name: build-translation + +on: + workflow_dispatch: + + pull_request: + branches: Dev-2.2 + paths: + - "**.xlf" + +jobs: + build-translation: + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install Multilingual App Toolkit extension + uses: microcompiler/install-vsix@db1f973c3d24d1ddc0c38f14d0e1e3a85b2ccb21 + with: + packagename: 'dts-publisher.mat2022' + - name: Build solution in Debug configuration + uses: ./.github/actions/build-solution + with: + build-mode: "Debug" + version: "${{ vars.PRERELEASE_VERSION }}.*" \ No newline at end of file diff --git a/.github/workflows/build-validate.yaml b/.github/workflows/build-validate.yaml deleted file mode 100644 index 63a50e1..0000000 --- a/.github/workflows/build-validate.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: build-debug - -defaults: - run: - working-directory: WinNUT_V2 - -on: - workflow_dispatch: - pull_request: - branches: [ main, dev-* ] # Build for dev primarily, probably don't need main...? - paths: - - '**.vb' - - '**.vbproj' - -env: - DOTNET_VERSION: '4.8' # The .NET SDK version to use - SLN_FILE: WinNUT_V2.sln - DEBUG_OUTPUT: WinNUT_V2/WinNUT-Client/bin/Debug - -jobs: - build: - - name: debug-build-${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] # Should have MSBuild. - steps: - # Make MSBuild available from $PATH. - - name: setup-msbuild - uses: microsoft/setup-msbuild@v2 - - - name: Checkout Code - uses: actions/checkout@v4 - - # msbuild cannot handle .vdproj Installer projects, so only build debug for now. - - name: Build solution - run: msbuild -t:build -restore -p:Configuration=Debug $env:SLN_FILE - - # For now, let msbuild continue autogenerating assembly versions and base everything off of that. - - name: Get AssemblyVersion generated by msbuild - id: getversion - uses: berglie/assembly-version/get@v1 - with: - directory: ${{ env.DEBUG_OUTPUT }} - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ format('WinNUT-Client-debugbuild-v{0}', steps.getversion.outputs.version) }} - if-no-files-found: error - path: ${{ env.DEBUG_OUTPUT }} - diff --git a/.github/workflows/get-ver.ps1 b/.github/workflows/get-ver.ps1 new file mode 100644 index 0000000..748f962 --- /dev/null +++ b/.github/workflows/get-ver.ps1 @@ -0,0 +1,22 @@ +# Verify valid semver, and provide it along with an AssemblyVersion-compatible string as env vars. + +# Set to the value provided by github.ref +param([string]$ghRef) + +$semVerRegex = "(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$" +$matchInfo = [regex]::Match($ghRef, $semVerRegex) + +if (!($matchInfo.Success)) { + Write-Host "Could not find valid semver within ref. string. Given: $ghRef" + Exit 1 +} + +$verRes = "VER={0}.{1}.{2}" -f $matchInfo.Groups["major"], $matchInfo.Groups["minor"], $matchInfo.Groups["patch"] +$semVerRes = "SEMVER=" + $matchInfo.Value +$isPr = "ISPRERELEASE=" + $matchInfo.Groups.ContainsKey("prerelease").ToString().ToLower() + +echo $verRes >> $env:GITHUB_OUTPUT +echo $semVerRes >> $env:GITHUB_OUTPUT +echo $isPr >> $env:GITHUB_OUTPUT + +Write-Host "Result: $verRes, $semVerRes, $isPr" \ No newline at end of file diff --git a/changelog.md b/CHANGELOG.md similarity index 81% rename from changelog.md rename to CHANGELOG.md index 8193b2a..13fd573 100644 --- a/changelog.md +++ b/CHANGELOG.md @@ -1,6 +1,73 @@ ## History: -### Further releases -Please see the [releases](https://github.com/nutdotnet/WinNUT-Client/releases) page for more recent releases. +### Pre-Release v2.2.8436 +After a longer than expected wait, the next pre-release is out with another set of bugfixes. + +## What's Changed +* Data directory location is more consistent depending on how WinNUT is being run (build type and location) by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/62 + * Also includes some improvements to the Logger +* WinNUT is more stable when the connection is lost, and the UI will no longer show strange data by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/64 +* Define UPS_States values as pow of 2 to fix state change detection by @supersmile2009 in https://github.com/nutdotnet/WinNUT-Client/pull/71 +* Fix release build by @supersmile2009 in https://github.com/nutdotnet/WinNUT-Client/pull/72 + +## New Contributors +* @supersmile2009 made their first contribution in https://github.com/nutdotnet/WinNUT-Client/pull/71 + +**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8356...v2.2.8436 + +### Pre-Release v2.2.8356 +## What's Changed +* Installer dependency cleanup by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/48 +* Logging fixes by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/50 +* Fix incorrect windows version detection by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/51 +* Fix List_Var_Gui error by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/52 +* Upgrade to .Net Framework 4.8 by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/53 +* Upgrade unhandled exception handling, cryptography by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/49 + * This fixes an error on startup that was affecting many people. Please upgrade to this version if WinNUT was crashing on startup for you. +* Respect Follow FSD setting by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/57 + +Also fixing the installer per #60 + +**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8331...v2.2.8356 + +### Pre-Release v2.2.8331 (Installer quick fix) +Quick fix to remove many dependencies that were added to the installer distribution of WinNUT. Only the installer has changed; please see the last release for the non-installer version. + +### Pre-Release v2.2.8328 +## Noticeable changes +* Re-enabled the Battery Runtime calculation. Not sure why it was disabled, please report any issues experienced with this. https://github.com/nutdotnet/WinNUT-Client/pull/33 +* Finally applied pending de-DE and zh-TW translations to WinNUT https://github.com/nutdotnet/WinNUT-Client/pull/39 +* Re-activate stop actions system and extensive core changes including status updates overhaul in https://github.com/nutdotnet/WinNUT-Client/pull/36 + * Also fixed resuming WinNUT from a suspended state +* Correct Interval/Delay value in https://github.com/nutdotnet/WinNUT-Client/pull/37 + +## Minor changes +* Created a build automation workflow so pull requests will have debug builds of WinNUT created and available for download automatically. +* Updated documentation for build & release, and translation procedures. +* Upgraded AGauge .Net Framework to solution's 4.7.2. +* Replaced Win10 static binary references with NuGet package to enable Toast Notifications while still building cross-platform (Win7 and up). + +## New Contributors +* @MartinKurtz made their first contribution in https://github.com/nutdotnet/WinNUT-Client/pull/30 + +**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8303...v2.2.8328 + +### Version 2.2.8303 +Attempting to fix versioning on MSI Installer for future smooth upgrades. No changes in main program since last version. + +**NOTE:** You will need to remove the old version (2.2 in Add Remove Programs list) for this and future upgrades to install correctly. + +**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8286...v2.2.8303 + +### Version 2.2.8286 +Beta/Prerelease +* Add Translation/zh-TW/zh-TW.csv for Chinese (Traditional) by @yrctw in https://github.com/nutdotnet/WinNUT-Client/pull/23 +* Large changes to Socket/UPS, DATA-STALE error handling by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/25 + +## New Contributors +* @yrctw made their first contribution in https://github.com/nutdotnet/WinNUT-Client/pull/23 + +**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8255...v2.2.8286 + ### Version 2.2.8255 Beta Release diff --git a/COPYING b/LICENSE.txt similarity index 100% rename from COPYING rename to LICENSE.txt diff --git a/WinNUT_V2/SharedAssemblyInfo.vb b/WinNUT_V2/SharedAssemblyInfo.vb index 6dc41cc..395adf9 100644 --- a/WinNUT_V2/SharedAssemblyInfo.vb +++ b/WinNUT_V2/SharedAssemblyInfo.vb @@ -5,6 +5,4 @@ Imports System.Resources - - diff --git a/WinNUT_V2/WinNUT-Client/My Project/app.manifest b/WinNUT_V2/WinNUT-Client/My Project/app.manifest index c19446f..7001365 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/app.manifest +++ b/WinNUT_V2/WinNUT-Client/My Project/app.manifest @@ -4,55 +4,59 @@ - - + - - + + - - - + + + + - + - + - + - +