Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 37 additions & 17 deletions .github/workflows/AutomatedRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ jobs:
BUILD_PLATFORM: [x86, x64]
env:
BUILD_CONFIG: Release
RELEASE_TYPE_TAG: "-beta" # For the moment, everything is beta.
RELEASE_TYPE_TAG: "beta" # For the moment, everything is beta.
RUN_LINTERS: false # These are not ready yet.
RUN_UNIT_TESTS: false # These are not ready yet.
BUILD_PLATFORM: ${{matrix.BUILD_PLATFORM}}
SOLUTION: ProcessMemory.sln
CSPROJECT: src/ProcessMemory/ProcessMemory.csproj
VERSION: 0.1.0

steps:
- name: Checkout
Expand All @@ -32,20 +31,35 @@ jobs:
fetch-depth: 0
ref: ${{github.ref}}

- name: Get C# project version
uses: Squirrelies/CI-CD/GetCSProjVersion@main
id: Get-CSProj-Version
with:
repository: ${{github.repository}}
ref: ${{github.ref}}
csproj-path: ${{env.CSPROJECT}}
- name: Read and process version.txt
id: Get-Version
run: |
$baseVersion = (Get-Content "version.txt" -Raw).Split('.')
$versionBuild = (${{vars.BUILD_NUMBER}} + 1)

- name: Get UTC DateTime
uses: Squirrelies/CI-CD/GetUTCDateTime@main
id: Get-UTC-DateTime
"VersionMajor=$($baseVersion[0])" >> $env:GITHUB_OUTPUT
"VersionMinor=$($baseVersion[1])" >> $env:GITHUB_OUTPUT
"VersionPatch=$($baseVersion[2])" >> $env:GITHUB_OUTPUT
"VersionBuild=$versionBuild" >> $env:GITHUB_OUTPUT
"VersionPreRelease=${{env.RELEASE_TYPE_TAG}}" >> $env:GITHUB_OUTPUT
"VersionCommitHash=$(("${{github.sha}}".substring(0, 7)))" >> $env:GITHUB_OUTPUT

- name: Set VERSION environment variable
run: echo 'VERSION=${{steps.Get-CSProj-Version.outputs.Version}}${{env.RELEASE_TYPE_TAG}}.${{steps.Get-UTC-DateTime.outputs.UTC-DateTime}}' >> $env:GITHUB_ENV
- name: Get SemVer
uses: Squirrelies/CI-CD/GetSemVerString@main
id: Get-SemVer
with:
versionMajor: ${{steps.Get-Version.outputs.VersionMajor}}
versionMinor: ${{steps.Get-Version.outputs.VersionMinor}}
versionPatch: ${{steps.Get-Version.outputs.VersionPatch}}
preRelease: ${{steps.Get-Version.outputs.VersionPreRelease}}
versionBuild: ${{steps.Get-Version.outputs.VersionBuild}}
commitHash: ${{steps.Get-Version.outputs.VersionCommitHash}}

- name: Set versioning environment variable
run: |
echo 'VERSION=${{steps.Get-SemVer.outputs.Version}}' >> $env:GITHUB_ENV
echo 'FILEVERSION=${{steps.Get-Version.outputs.VersionMajor}}.${{steps.Get-Version.outputs.VersionMinor}}.${{steps.Get-Version.outputs.VersionPatch}}.${{steps.Get-Version.outputs.VersionBuild}}' >> $env:GITHUB_ENV
echo 'ASSEMBLYVERSION=${{steps.Get-Version.outputs.VersionMajor}}.${{steps.Get-Version.outputs.VersionMinor}}.0.0' >> $env:GITHUB_ENV

- name: Build Native Library
uses: Squirrelies/CI-CD/BuildMSYS2CMakeVCPkgProject@main
Expand All @@ -58,7 +72,7 @@ jobs:
preset-configuration: ${{env.BUILD_CONFIG}}
preset-configuration-tidy: ${{ env.RUN_LINTERS == true && format('{0}-Tidy', env.BUILD_CONFIG) || ''}}
run-unit-tests: ${{env.RUN_UNIT_TESTS}}
additional-cmake-args: -DARCH=${{matrix.BUILD_PLATFORM}}
additional-cmake-args: -DARCH=${{matrix.BUILD_PLATFORM}} -DRC_VERSION_MAJOR=${{steps.Get-Version.outputs.VersionMajor}} -DRC_VERSION_MINOR=${{steps.Get-Version.outputs.VersionMinor}} -DRC_VERSION_PATCH=${{steps.Get-Version.outputs.VersionPatch}} -DRC_VERSION_BUILD=${{steps.Get-Version.outputs.VersionBuild}} -DRC_VERSION_PRERELEASE_TAG=${{steps.Get-Version.outputs.VersionPreRelease}} -DRC_VERSION_BUILD_HASH=${{steps.Get-Version.outputs.VersionCommitHash}}

- name: Setup NuGet
uses: NuGet/setup-nuget@v2
Expand All @@ -73,10 +87,16 @@ jobs:
run: dotnet restore $env:SOLUTION --verbosity normal

- name: Build .NET Project
run: dotnet build $env:SOLUTION /p:"Configuration=${{env.BUILD_CONFIG}};Platform=$env:BUILD_PLATFORM;VERSION=$env:VERSION" --no-restore --verbosity normal
run: dotnet build $env:SOLUTION /p:"Configuration=${{env.BUILD_CONFIG}};Platform=$env:BUILD_PLATFORM;VERSION=$env:VERSION;FILEVERSION=$env:FILEVERSION;ASSEMBLYVERSION=$env:ASSEMBLYVERSION" --no-restore --verbosity normal

- name: Run .NET Project Unit Tests
run: dotnet test /p:"Configuration=${{env.BUILD_CONFIG}};Platform=$env:BUILD_PLATFORM;VERSION=$env:VERSION" --no-restore --no-build --verbosity normal
if: ${{ !cancelled() && env.RUN_UNIT_TESTS == 'true' }}
run: dotnet test /p:"Configuration=${{env.BUILD_CONFIG}};Platform=$env:BUILD_PLATFORM;VERSION=$env:VERSION;FILEVERSION=$env:FILEVERSION;ASSEMBLYVERSION=$env:ASSEMBLYVERSION" --no-restore --no-build --verbosity normal

- name: Publish NuGet Package
run: nuget push **\*.nupkg -Source "https://api.nuget.org/v3/index.json" -ApiKey "${{secrets.NUGET_API_KEY}}" -SkipDuplicate

- name: Update build number variable
env:
GH_TOKEN: ${{ secrets.GH_VARIABLE_RW_TOKEN }}
run: gh variable set BUILD_NUMBER -b${{ steps.Get-Version.outputs.VersionBuild }}
85 changes: 65 additions & 20 deletions .github/workflows/ManualRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ on:
releaseTypeTag: # Use -alpha, -beta, or -rc for pre-release. An empty string for stable.
description: "Release type tag"
required: true
default: "-beta"
default: "beta"
type: choice
options:
- "-alpha"
- "-beta"
- "-RC"
- "alpha"
- "beta"
- "RC"
- ""
runLinters:
description: "Run Linters"
Expand All @@ -31,6 +31,11 @@ on:
required: false
default: false
type: boolean
publish:
description: "Publish to NuGet"
required: true
default: true
type: boolean

jobs:
Build:
Expand All @@ -46,7 +51,6 @@ jobs:
BUILD_PLATFORM: ${{matrix.BUILD_PLATFORM}}
SOLUTION: ProcessMemory.sln
CSPROJECT: src/ProcessMemory/ProcessMemory.csproj
VERSION: 0.1.0

steps:
- name: Checkout
Expand All @@ -55,24 +59,47 @@ jobs:
fetch-depth: 0
ref: ${{github.ref}}

- name: Get C# project version
uses: Squirrelies/CI-CD/GetCSProjVersion@main
id: Get-CSProj-Version
with:
repository: ${{github.repository}}
ref: ${{github.ref}}
csproj-path: ${{env.CSPROJECT}}
- name: Read and process version.txt
id: Get-Version
run: |
$baseVersion = (Get-Content "version.txt" -Raw).Split('.')
$versionBuild = (${{vars.BUILD_NUMBER}} + 1)

- name: Get UTC DateTime
uses: Squirrelies/CI-CD/GetUTCDateTime@main
id: Get-UTC-DateTime
"VersionMajor=$($baseVersion[0])" >> $env:GITHUB_OUTPUT
"VersionMinor=$($baseVersion[1])" >> $env:GITHUB_OUTPUT
"VersionPatch=$($baseVersion[2])" >> $env:GITHUB_OUTPUT
"VersionBuild=$versionBuild" >> $env:GITHUB_OUTPUT
"VersionPreRelease=${{inputs.releaseTypeTag}}" >> $env:GITHUB_OUTPUT
"VersionCommitHash=$(("${{github.sha}}".substring(0, 7)))" >> $env:GITHUB_OUTPUT

- name: Set VERSION environment variable
run: echo 'VERSION=${{steps.Get-CSProj-Version.outputs.Version}}${{inputs.releaseTypeTag}}.${{steps.Get-UTC-DateTime.outputs.UTC-DateTime}}' >> $env:GITHUB_ENV
- name: Get SemVer
uses: Squirrelies/CI-CD/GetSemVerString@main
id: Get-SemVer
with:
versionMajor: ${{steps.Get-Version.outputs.VersionMajor}}
versionMinor: ${{steps.Get-Version.outputs.VersionMinor}}
versionPatch: ${{steps.Get-Version.outputs.VersionPatch}}
preRelease: ${{steps.Get-Version.outputs.VersionPreRelease}}
versionBuild: ${{steps.Get-Version.outputs.VersionBuild}}
commitHash: ${{steps.Get-Version.outputs.VersionCommitHash}}

- name: Set versioning environment variable
run: |
echo 'VERSION=${{steps.Get-SemVer.outputs.Version}}' >> $env:GITHUB_ENV
echo 'FILEVERSION=${{steps.Get-Version.outputs.VersionMajor}}.${{steps.Get-Version.outputs.VersionMinor}}.${{steps.Get-Version.outputs.VersionPatch}}.${{steps.Get-Version.outputs.VersionBuild}}' >> $env:GITHUB_ENV
echo 'ASSEMBLYVERSION=${{steps.Get-Version.outputs.VersionMajor}}.${{steps.Get-Version.outputs.VersionMinor}}.0.0' >> $env:GITHUB_ENV

- name: Build Native Library
uses: Squirrelies/CI-CD/BuildMSYS2CMakeVCPkgProject@main
id: build-native-library
env:
RC_VERSION: ${{steps.Get-SemVer.outputs.Version}}
RC_VERSION_MAJOR: ${{steps.Get-Version.outputs.VersionMajor}}
RC_VERSION_MINOR: ${{steps.Get-Version.outputs.VersionMinor}}
RC_VERSION_PATCH: ${{steps.Get-Version.outputs.VersionPatch}}
RC_VERSION_BUILD: ${{steps.Get-Version.outputs.VersionBuild}}
RC_VERSION_PRERELEASE_TAG: ${{steps.Get-Version.outputs.VersionPreRelease}}
RC_VERSION_BUILD_HASH: ${{steps.Get-Version.outputs.VersionCommitHash}}
with:
root-path: ./src/ProcessMemoryNative
msys2-msystem: ${{ matrix.BUILD_PLATFORM == 'x64' && 'clang64' || 'mingw32' }}
Expand All @@ -81,7 +108,7 @@ jobs:
preset-configuration: ${{inputs.buildConfig}}
preset-configuration-tidy: ${{ inputs.runLinters == true && format('{0}-Tidy', inputs.buildConfig) || ''}}
run-unit-tests: ${{inputs.unitTests}}
additional-cmake-args: -DARCH=${{matrix.BUILD_PLATFORM}}
additional-cmake-args: -DARCH=${{matrix.BUILD_PLATFORM}} -DRC_VERSION=${{steps.Get-SemVer.outputs.Version}} -DRC_VERSION_MAJOR=${{steps.Get-Version.outputs.VersionMajor}} -DRC_VERSION_MINOR=${{steps.Get-Version.outputs.VersionMinor}} -DRC_VERSION_PATCH=${{steps.Get-Version.outputs.VersionPatch}} -DRC_VERSION_BUILD=${{steps.Get-Version.outputs.VersionBuild}} -DRC_VERSION_PRERELEASE_TAG=${{steps.Get-Version.outputs.VersionPreRelease}} -DRC_VERSION_BUILD_HASH=${{steps.Get-Version.outputs.VersionCommitHash}}

- name: Setup NuGet
uses: NuGet/setup-nuget@v2
Expand All @@ -96,10 +123,28 @@ jobs:
run: dotnet restore $env:SOLUTION --verbosity normal

- name: Build .NET Project
run: dotnet build $env:SOLUTION /p:"Configuration=${{inputs.buildConfig}};Platform=$env:BUILD_PLATFORM;VERSION=$env:VERSION" --no-restore --verbosity normal
run: dotnet build $env:SOLUTION /p:"Configuration=${{inputs.buildConfig}};Platform=$env:BUILD_PLATFORM;VERSION=$env:VERSION;FILEVERSION=$env:FILEVERSION;ASSEMBLYVERSION=$env:ASSEMBLYVERSION" --no-restore --verbosity normal

- name: Run .NET Project Unit Tests
run: dotnet test /p:"Configuration=${{inputs.buildConfig}};Platform=$env:BUILD_PLATFORM;VERSION=$env:VERSION" --no-restore --no-build --verbosity normal
if: ${{ !cancelled() && inputs.unitTests == 'true' }}
run: dotnet test /p:"Configuration=${{inputs.buildConfig}};Platform=$env:BUILD_PLATFORM;VERSION=$env:VERSION;FILEVERSION=$env:FILEVERSION;ASSEMBLYVERSION=$env:ASSEMBLYVERSION" --no-restore --no-build --verbosity normal

- name: Publish NuGet Package
if: ${{ !cancelled() && inputs.publish == 'true' }}
run: nuget push **\*.nupkg -Source "https://api.nuget.org/v3/index.json" -ApiKey "${{secrets.NUGET_API_KEY}}" -SkipDuplicate

- name: Update build number variable
if: ${{ !cancelled() && inputs.publish == 'true' }} # Only update the build number if the NuGet package was published
env:
GH_TOKEN: ${{ secrets.GH_VARIABLE_RW_TOKEN }}
run: gh variable set BUILD_NUMBER -b${{ steps.Get-Version.outputs.VersionBuild }}

- name: Upload publish artifacts
uses: actions/upload-artifact@v4
with:
name: ProcessMemory${{ env.BUILD_PLATFORM == 'x64' && '64' || '32'}}_v${{env.VERSION}}
path: |
src/ProcessMemory/bin/${{env.BUILD_PLATFORM}}/${{inputs.buildConfig}}/netstandard2.1/ProcessMemory${{ env.BUILD_PLATFORM == 'x64' && '64' || '32'}}.dll
src/ProcessMemory/bin/${{env.BUILD_PLATFORM}}/${{inputs.buildConfig}}/netstandard2.1/ProcessMemory${{ env.BUILD_PLATFORM == 'x64' && '64' || '32'}}.pdb
src/ProcessMemoryNative/build/ProcessMemory.Native.${{ env.BUILD_PLATFORM == 'x64' && '64' || '32'}}.dll
src/ProcessMemoryNative/build/ProcessMemory.Native.${{ env.BUILD_PLATFORM == 'x64' && '64' || '32'}}.pdb
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
6 changes: 3 additions & 3 deletions src/ProcessMemory/ProcessMemory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<PropertyGroup>
<Product>Process Memory Access Library ($(Platform))</Product>
<Description>A library for reading and writing process memory.</Description>
<Version>4.0.6</Version>
<FileVersion>4.0.6</FileVersion>
<AssemblyVersion>4.0.0</AssemblyVersion>
<Version>0.1.0</Version>
<FileVersion>0.1.0</FileVersion>
<AssemblyVersion>0.1.0</AssemblyVersion>
<AssemblyName>ProcessMemory</AssemblyName>

<PackageId>$(AssemblyName)</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion src/ProcessMemoryNative/src/VersionInfo.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define VER_FILEVERSION_STR "@RC_VERSION_MAJOR@.@RC_VERSION_MINOR@.@RC_VERSION_PATCH@.@RC_VERSION_BUILD@\0"

#define VER_PRODUCTVERSION @RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_PATCH@,@RC_VERSION_BUILD@
#define VER_PRODUCTVERSION_STR "@RC_VERSION_MAJOR@.@RC_VERSION_MINOR@.@RC_VERSION_PATCH@ (Build #@RC_VERSION_BUILD@)\0"
#define VER_PRODUCTVERSION_STR "@RC_VERSION@\0"

#define VER_PRIVATEBUILD 0
#define VER_PRERELEASE 0
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.7