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
99 changes: 99 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: CI-CD

# Concurrency control ensures that only one instance of the workflow runs at a time for a given reference.
# This prevents multiple runs from interfering with each other.
# Reference: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
- development

pull_request:
branches:
- main
- development

# To allow manual execution
workflow_dispatch:


env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./src/RaspberryDebugger.sln

PROJECT_FILE_PATH: ./src/RaspberryDebugger/RaspberryDebugger.csproj

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_PLATFORM: 'Any CPU'
BUILD_PLATFORM_FOR_PROJECTS: 'AnyCPU'

permissions:
contents: read

jobs:
# build_Linux:
build_Windows:
runs-on: [windows-2022]

strategy:
matrix:
configuration: [Release]
platform: [Any CPU]

steps:
- name: 🤖 Checkout code
uses: actions/checkout@v4
with:
path: './src'
# Fetch depth needs to be set to 0 to use Nerdbank.GitVersioning
fetch-depth: 0

- name: 🤖 Checkout NeonSDK
uses: actions/checkout@v4
with:
repository: bakerhillpins/neonSDK
path: './neonSDK'
ref: refs/heads/Fix_Issue#94

# Install the .NET Core workload
- name: 🤖 Install .NET Core
uses: actions/setup-dotnet@v4
with:
global-json-file: ./src/global.json
env:
DOTNET_INSTALL_DIR: "${{ runner.temp }}\\dotnet"

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: >
msbuild
"${{ env.SOLUTION_FILE_PATH }}"
-verbosity:minimal
/t:Restore
/p:Configuration="${{ env.Configuration }}"

env:
Configuration: ${{ matrix.configuration }}

# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: >
msbuild
-verbosity:minimal
"${{ env.SOLUTION_FILE_PATH }}"
/p:Configuration="${{ env.Configuration }}"

env:
Configuration: ${{ matrix.configuration }}

4 changes: 2 additions & 2 deletions RaspberryDebugger/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3.0.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
[assembly: AssemblyVersion("3.3.1.0")]
[assembly: AssemblyFileVersion("3.3.1.0")]
42 changes: 42 additions & 0 deletions RaspberryDebugger/RaspberryDebugger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,48 @@
<Name>Neon.SSH</Name>
</ProjectReference>
</ItemGroup>
<UsingTask TaskName="UpdateVsixManifestVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<FilePath ParameterType="System.String" Required="true" />
<Version ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Text.RegularExpressions" />
<Code Type="Fragment" Language="cs">
<![CDATA[
string content = File.ReadAllText(FilePath);
string updatedContent = Regex.Replace(content,
"<Identity Id=\"Raspberry Debugger\\.4f9de82d-0bbe-493c-8c12-9dbd38e93008\" Version=\".*?\" Language=\"en-US\" Publisher=\"GingerMintSoft\" />",
string.Format("<Identity Id=\"Raspberry Debugger.4f9de82d-0bbe-493c-8c12-9dbd38e93008\" Version=\"{0}\" Language=\"en-US\" Publisher=\"GingerMintSoft\" />", Version));
File.WriteAllText(FilePath, updatedContent);
]]>
</Code>
</Task>
</UsingTask>

<Target Name="SetVersion" BeforeTargets="BeforeBuild">
<PropertyGroup>
<VsixVersion>3.3.$(Year)$(DayOfYear).$(Time)</VsixVersion>
</PropertyGroup>

<ItemGroup>
<VsixManifestFile Include="source.extension.vsixmanifest" />
</ItemGroup>

<Message Text="Updating VSIX manifest version to $(VsixVersion)" Importance="High" />

<UpdateVsixManifestVersion
FilePath="source.extension.vsixmanifest"
Version="$(VsixVersion)" />
</Target>

<PropertyGroup>
<Year>$([System.DateTime]::Now.Year)</Year>
<DayOfYear>$([System.DateTime]::Now.DayOfYear)</DayOfYear>
<Time>$([System.DateTime]::Now.ToString("HHmm"))</Time>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "8.0.0",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}