Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
malware-dev committed Jan 4, 2025
1 parent 4d01988 commit 4af5d83
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 56 deletions.
109 changes: 55 additions & 54 deletions .github/workflows/buildwithartefacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
# Job to build individual tool projects
build-dependent:
build-tools:
runs-on: ubuntu-latest

defaults:
Expand All @@ -31,6 +31,7 @@ jobs:
strategy:
matrix:
project:
- "Mdk.CheckDotNet/Mdk.CheckDotNet.csproj"
- "Mdk.CommandLine/Mdk.CommandLine.csproj"
- "Mdk.Notification.Windows/Mdk.Notification.Windows.csproj"
steps:
Expand Down Expand Up @@ -73,64 +74,64 @@ jobs:
retention-days: 7
path: ./output/**/*

# Job to build individual tool projects
build-self-contained:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./Source
shell: pwsh

strategy:
matrix:
project:
- "Mdk.CheckDotNet/Mdk.CheckDotNet.csproj"
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x

- name: Build tool project
run: |
dotnet publish ${{ matrix.project }} -c Release -o ../output --self-contained true -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None
- name: Prepare artifact name
run: |
$outputDir = "../output"
$exePath = Get-ChildItem $outputDir -Filter *.exe | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if (-not $exePath) {
Write-Error "No executable found in output directory!"
exit 1
}
Write-Host "Generated executable: $exePath"
$artifactName = $exePath.BaseName
Write-Host "Artifact name: $artifactName"
echo "ARTIFACT_NAME=$artifactName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
- name: Debug artifact name
run: |
echo "ARTIFACT_NAME is: ${{ env.ARTIFACT_NAME }}"
- name: Upload tool artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}-artifact
if-no-files-found: error
retention-days: 7
path: ./output/**/*
# # Job to build individual tool projects
# build-self-contained:
# runs-on: ubuntu-latest
#
# defaults:
# run:
# working-directory: ./Source
# shell: pwsh
#
# strategy:
# matrix:
# project:
# - "Mdk.CheckDotNet/Mdk.CheckDotNet.csproj"
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 9.x
#
# - name: Build tool project
# run: |
# dotnet publish ${{ matrix.project }} -c Release -o ../output --self-contained true -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None
#
# - name: Prepare artifact name
# run: |
# $outputDir = "../output"
# $exePath = Get-ChildItem $outputDir -Filter *.exe | Sort-Object LastWriteTime -Descending | Select-Object -First 1
#
# if (-not $exePath) {
# Write-Error "No executable found in output directory!"
# exit 1
# }
#
# Write-Host "Generated executable: $exePath"
# $artifactName = $exePath.BaseName
# Write-Host "Artifact name: $artifactName"
# echo "ARTIFACT_NAME=$artifactName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
#
# - name: Debug artifact name
# run: |
# echo "ARTIFACT_NAME is: ${{ env.ARTIFACT_NAME }}"
#
# - name: Upload tool artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.ARTIFACT_NAME }}-artifact
# if-no-files-found: error
# retention-days: 7
# path: ./output/**/*

# Job to build the primary project
build-primary:
runs-on: ubuntu-latest
needs:
- build-dependent
- build-self-contained
- build-tools
# - build-self-contained

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion Source/Mdk.CommandLine/Mdk.CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Configurations>Release;Debug</Configurations>
<Platforms>x64</Platforms>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Source/Mdk.CommandLine/PackageVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0-alpha.16
2.1.0-alpha.17
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<Configurations>Release;Debug</Configurations>
<Platforms>x64</Platforms>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions Source/Mdk.Notification/Mdk.Notification.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationIcon>Assets\appicon.ico</ApplicationIcon>
<AssemblyName>mdknotify</AssemblyName>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 4af5d83

Please sign in to comment.