diff --git a/.github/workflows/Build mR-NB.yml b/.github/workflows/Build mR-NB.yml new file mode 100644 index 00000000..640705ac --- /dev/null +++ b/.github/workflows/Build mR-NB.yml @@ -0,0 +1,110 @@ +name: Build mR-NB + +on: + push: + branches: + - v1.78.2-dev + +jobs: + Build-Release: + runs-on: windows-2022 + outputs: + zipname: ${{ steps.version.outputs.zipname }} + version: ${{ steps.version.outputs.version }} + build: ${{ steps.version.outputs.build }} + steps: + - name: 01. Checkout Repository + uses: actions/checkout@v4 + + - name: 02. Setup MSBuild + uses: microsoft/setup-msbuild@v2 + with: + vs-version: '17.14.11' + + - name: Install and run dotnet-t4 to transform T4 templates + shell: pwsh + run: | + dotnet tool install --global dotnet-t4 + $ttFile = "$env:GITHUB_WORKSPACE\mRemoteNG\Properties\AssemblyInfo.tt" + t4 $ttFile + + - name: 04. Cache NuGet Packages + uses: actions/cache@v3 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: 05. Restore NuGet Packages + shell: pwsh + run: dotnet restore + + - name: 06. Build Release + shell: pwsh + run: msbuild "$Env:GITHUB_WORKSPACE\mRemoteNG.sln" -p:Configuration="Release" -p:Platform=x64 /verbosity:minimal + + - name: 07. Generate Version Info + id: version + shell: pwsh + run: | + $assemblyInfoPath = "${{ github.workspace }}\mRemoteNG\Properties\AssemblyInfo.cs" + $line = Get-Content $assemblyInfoPath | Where-Object { $_ -match 'AssemblyVersion\("(.+?)"\)' } + if ($line -match 'AssemblyVersion\("(?\d+\.\d+\.\d+)\.(?\d+)"\)') { + $version = $matches['ver'] + $build = $matches['build'] + } else { + throw "Could not extract version and build number" + } + $date = Get-Date -Format "ddMMyyyy" + $zipName = "mRemoteNG-$version-(NB_$build)_$date.zip" + echo "zipname=$zipName" >> $env:GITHUB_OUTPUT + + - name: 08. Upload Release Output as Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.version.outputs.zipname }} + path: ${{ github.workspace }}\mRemoteNG\bin\x64\Release\win-x64\* + + Create-Release: + needs: [Build-Release] + runs-on: ubuntu-22.04 + # Add explicit permissions for this job + permissions: + contents: write + + steps: + - name: 01. Checkout Repository + uses: actions/checkout@v4 + + - name: 02. Download Artifact + uses: actions/download-artifact@v4 + with: + name: ${{ needs.Build-Release.outputs.zipname }} + path: ./ + + - name: !!!. Debug Info + run: | + echo "=== DEBUG: Job Outputs ===" + echo "Zipname: ${{ needs.Build-Release.outputs.zipname }}" + echo "Version: ${{ needs.Build-Release.outputs.version }}" + echo "Build: ${{ needs.Build-Release.outputs.build }}" + echo "=== DEBUG: Files ===" + ls -la + + + - name: 03. Create Release and Upload Asset + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Create tag name + TAG="v${{ needs.Build-Release.outputs.version }}-${{ needs.Build-Release.outputs.build }}-${GITHUB_RUN_NUMBER}" + echo "Tag: "v${{ needs.Build-Release.outputs.version }}-${{ needs.Build-Release.outputs.build }}-${GITHUB_RUN_NUMBER}"" + + # Create release with tag and attach artifact + gh release create "$TAG" \ + --title "mRemoteNG ${{ needs.Build-Release.outputs.version }} Build ${{ needs.Build-Release.outputs.build }}" \ + --notes "Development build of mRemoteNG version ${{ needs.Build-Release.outputs.version }}" \ + --prerelease \ + "${{ needs.Build-Release.outputs.zipname }}" diff --git a/.github/workflows/build-x86_64.yml b/.github/workflows/build-x86_64.yml deleted file mode 100644 index c6e53159..00000000 --- a/.github/workflows/build-x86_64.yml +++ /dev/null @@ -1,130 +0,0 @@ -name: Build x86_64 - -on: - push: - branches: - - v1.77.3-dev - -jobs: - Build-Debug-MSI: - runs-on: windows-2022 - steps: - - name: 01. Copy repository - uses: actions/checkout@v4 - - - name: 02. Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.3.1 # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - with: - vs-version: '17.12.4' - - - name: 03. Restore nuget packages for solution - shell: pwsh - run: | - dotnet restore - - - name: 04. Compile mRemoteNG - shell: pwsh - run: | - msbuild "$Env:GITHUB_WORKSPACE\mRemoteNG.sln" -p:Configuration="Debug Installer" -p:Platform=x64 /verbosity:normal - - - name: 05. Publish MSI as Artifact - uses: actions/upload-artifact@v4 - with: - name: debug-msi-x86_64 - path: ${{ github.workspace }}\mRemoteNGInstaller\Installer\bin\x64\Debug\en-US\ - if-no-files-found: error - - Build-Debug-Portable: - runs-on: windows-2022 - steps: - - name: 01. Copy repository - uses: actions/checkout@v4 - - - name: 02. Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.3.1 # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - with: - vs-version: '17.8.3' - - - name: 03. Restore nuget packages for solution - shell: pwsh - run: | - dotnet restore - - - name: 04. Compile mRemoteNG - shell: pwsh - run: | - msbuild "$Env:GITHUB_WORKSPACE\mRemoteNG.sln" -p:Configuration="Debug Portable" -p:Platform=x64 /verbosity:normal - - - name: 05. Publish Portable Binary as Artifact - uses: actions/upload-artifact@v4 - with: - name: debug-portable-x86_64 - path: ${{ github.workspace }}\mRemoteNG\bin\x64\Debug Portable\ - if-no-files-found: error - - Build-Release: - runs-on: windows-2022 - steps: - - name: 01. Copy repository - uses: actions/checkout@v4 - - - name: 02. Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.3.1 # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - with: - vs-version: '17.12.4' - - - name: 03. Restore nuget packages for solution - shell: pwsh - run: | - dotnet restore - - - name: 04. Compile mRemoteNG - shell: pwsh - run: | - msbuild "$Env:GITHUB_WORKSPACE\mRemoteNG.sln" -p:Configuration="Release Installer and Portable" -p:Platform=x64 /verbosity:normal - - - name: 05. Publish MSI Binary as Artifact - uses: actions/upload-artifact@v4 - with: - name: release-msi-x86_64 - path: ${{ github.workspace }}\mRemoteNGInstaller\Installer\bin\x64\Release\en-US\ - if-no-files-found: error - - - name: 06. Publish Portable Binary as Artifact - uses: actions/upload-artifact@v4 - with: - name: release-portable-x86_64 - path: ${{ github.workspace }}\mRemoteNG\bin\x64\Release - if-no-files-found: error - - Create-Release: - needs: [Build-Debug-MSI, Build-Debug-Portable, Build-Release] - runs-on: ubuntu-22.04 - steps: - - name: 01. Copy repository - uses: actions/checkout@v4 - - - name: 02. Download Artifacts - uses: actions/download-artifact@v4 - - - name: 03. Create compressed archives # Needs to be done because "actions/download-artifact@v4" is extracting the zipped Artifacts - shell: bash - run: | - zip -r debug-msi-x86_64.zip debug-msi-x86_64/ - zip -r debug-portable-x86_64.zip debug-portable-x86_64/ - zip -r release-msi-x86_64.zip release-msi-x86_64/ - zip -r release-portable-x86_64.zip release-portable-x86_64/ - - - name: 04. Create Release - shell: bash - env: - GH_TOKEN: ${{ github.token }} - run: | - gh release create "v1.77.3-dev-${GITHUB_RUN_NUMBER}" \ - --title "v1.77.3-dev-${GITHUB_RUN_NUMBER}" \ - --prerelease \ - --generate-notes \ - $GITHUB_WORKSPACE/debug-msi-x86_64.zip \ - $GITHUB_WORKSPACE/debug-portable-x86_64.zip \ - $GITHUB_WORKSPACE/release-msi-x86_64.zip \ - $GITHUB_WORKSPACE/release-portable-x86_64.zip diff --git a/Directory.Packages.props b/Directory.Packages.props index d21863b0..36ec4b34 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,8 +5,8 @@ $(NoWarn);NU1507 - - + + diff --git a/mRemoteNG/Properties/AssemblyInfo.cs b/mRemoteNG/Properties/AssemblyInfo.cs index ada79c0a..f98f7923 100644 --- a/mRemoteNG/Properties/AssemblyInfo.cs +++ b/mRemoteNG/Properties/AssemblyInfo.cs @@ -1,12 +1,12 @@ -// // This code was generated by a script. Any changes made manually will be lost // the next time this code is regenerated. -// using System.Reflection; using System.Resources; +// Compute version values + // General Information [assembly: AssemblyTitle("mRemoteNG")] [assembly: AssemblyDescription("Multi-Remote Next Generation Connection Manager")] @@ -18,11 +18,10 @@ using System.Resources; [assembly: AssemblyCulture("")] // Version information -[assembly: AssemblyVersion("1.78.2.3118")] -[assembly: AssemblyFileVersion("1.78.2.3118")] +[assembly: AssemblyVersion("1.78.2.3120")] +[assembly: AssemblyFileVersion("1.78.2.3120")] [assembly: NeutralResourcesLanguageAttribute("en-US")] -[assembly: AssemblyInformationalVersion("1.78.2 (Nightly Build 3118)")] +[assembly: AssemblyInformationalVersion("1.78.2 (Nightly Build 3120)")] // Logging -[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")] - +[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")] \ No newline at end of file diff --git a/mRemoteNG/Properties/AssemblyInfo.tt b/mRemoteNG/Properties/AssemblyInfo.tt index 9c315f0d..fa065ec8 100644 --- a/mRemoteNG/Properties/AssemblyInfo.tt +++ b/mRemoteNG/Properties/AssemblyInfo.tt @@ -1,50 +1,38 @@ <#@ template debug="true" hostspecific="true" language="C#" #> - <#@ output extension=".cs" #> -// + // This code was generated by a script. Any changes made manually will be lost // the next time this code is regenerated. -// using System.Reflection; using System.Resources; +// Compute version values +<# + int major = 1; + int minor = 78; + int revision = 2; + string channel = "Nightly Build"; + DateTime lastReleaseDate = new DateTime(2019, 9, 2); + TimeSpan elapsed = DateTime.UtcNow - lastReleaseDate; + int build = (int)(elapsed.TotalMinutes / 1000); +#> + // General Information [assembly: AssemblyTitle("mRemoteNG")] [assembly: AssemblyDescription("Multi-Remote Next Generation Connection Manager")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Profi-KOM Ltd.")] [assembly: AssemblyProduct("mRemoteNG Connection Manager")] -[assembly: AssemblyCopyright("(c) 2025 mRemoteNG")] +[assembly: AssemblyCopyright("(c) <#= DateTime.UtcNow.Year #> mRemoteNG")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Version information -[assembly: AssemblyVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #>.<#= this.build #>")] -[assembly: AssemblyFileVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #>.<#= this.build #>")] +[assembly: AssemblyVersion("<#= major #>.<#= minor #>.<#= revision #>.<#= build #>")] +[assembly: AssemblyFileVersion("<#= major #>.<#= minor #>.<#= revision #>.<#= build #>")] [assembly: NeutralResourcesLanguageAttribute("en-US")] -[assembly: AssemblyInformationalVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #> (<#= this.channel #> <#= this.build #>)")] +[assembly: AssemblyInformationalVersion("<#= major #>.<#= minor #>.<#= revision #> (<#= channel #> <#= build #>)")] // Logging -[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")] - -<#+ - //build is a number of days from date of last release + curent hour + curent minute of build - int major = 1; - int minor = 78; - int revision = 2; - string channel = "Nightly Build"; - DateTime lastReleaseDate = new DateTime(2019, 9, 2); - DateTime CurrentDate = DateTime.UtcNow; - TimeSpan elapsedTime; - double TotalMinutes; - int build; - - public override void Initialize() - { - elapsedTime = CurrentDate.Subtract(lastReleaseDate); - TotalMinutes = elapsedTime.TotalMinutes; - build = (int)(TotalMinutes / 1000); - base.Initialize(); - } -#> \ No newline at end of file +[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")] \ No newline at end of file diff --git a/mRemoteNG/mRemoteNG.csproj b/mRemoteNG/mRemoteNG.csproj index 709c212e..41124aac 100644 --- a/mRemoteNG/mRemoteNG.csproj +++ b/mRemoteNG/mRemoteNG.csproj @@ -533,12 +533,6 @@ - - - - - -