From de36a9daf7f5b7215f906e707c1ab041961c67be Mon Sep 17 00:00:00 2001 From: James McMahon Date: Fri, 13 Nov 2026 09:17:11 +0000 Subject: [PATCH 1/2] fix: extract managed assemblies in single-file CLI releases --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0076c81..4d7e845 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -71,7 +71,7 @@ jobs: output="artifacts/cli/$rid" dotnet publish src/PackageCascade.Cli/PackageCascade.Cli.csproj \ -c Release -r "$rid" --self-contained true -o "$output" \ - -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true \ + -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true \ -p:DebugType=embedded \ -p:Version="$VERSION" -p:ContinuousIntegrationBuild=true -p:RepositoryUrl="$REPOSITORY_URL" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a1f9b4..a0e43f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,43 @@ jobs: with: global-json-file: global.json - name: Publish CLI - run: dotnet publish src/PackageCascade.Cli/PackageCascade.Cli.csproj -c Release -r ${{ matrix.rid }} --self-contained true -o artifacts/cli -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=embedded + run: dotnet publish src/PackageCascade.Cli/PackageCascade.Cli.csproj -c Release -r ${{ matrix.rid }} --self-contained true -o artifacts/cli -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:DebugType=embedded - name: Run CLI help shell: bash run: ./artifacts/cli/${{ matrix.binary }} --help + - name: Plan a netstandard project with the published CLI + if: matrix.rid == 'linux-x64' + shell: bash + run: | + fixture="$(mktemp -d)" + trap 'rm -rf "$fixture"' EXIT + mkdir -p "$fixture/src/Fixture" + cat > "$fixture/Packages.slnx" <<'EOF' + + + + EOF + cat > "$fixture/src/Fixture/Fixture.csproj" <<'EOF' + + + netstandard2.0 + + + EOF + git -C "$fixture" init + git -C "$fixture" add . + git -C "$fixture" -c user.name='PackageCascade CI' -c user.email='ci@example.invalid' commit -m 'chore: add fixture' + ./artifacts/cli/PackageCascade.Cli plan "$fixture/Packages.slnx" --repository "$fixture" --outfile "$fixture/plan.json" + python3 - "$fixture/plan.json" <<'PY' + import json + import sys + + with open(sys.argv[1], encoding='utf-8') as plan_file: + plan = json.load(plan_file) + assert len(plan['Packages']) == 1, plan + package = plan['Packages'][0] + assert package['PackageId'] == 'Fixture', package + assert package['ProjectPath'] == 'src/Fixture/Fixture.csproj', package + assert package['Version'] == '0.1.0', package + assert package['Reasons'] == [{'Type': 'InitialRelease'}], package + PY From 768ff1136480e39c2023e98d76d412b6c8923b0a Mon Sep 17 00:00:00 2001 From: James McMahon Date: Fri, 13 Nov 2026 09:23:00 +0000 Subject: [PATCH 2/2] test: use jq for published CLI plan assertions --- .github/workflows/ci.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0e43f0..7184b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,16 +103,10 @@ jobs: git -C "$fixture" add . git -C "$fixture" -c user.name='PackageCascade CI' -c user.email='ci@example.invalid' commit -m 'chore: add fixture' ./artifacts/cli/PackageCascade.Cli plan "$fixture/Packages.slnx" --repository "$fixture" --outfile "$fixture/plan.json" - python3 - "$fixture/plan.json" <<'PY' - import json - import sys - - with open(sys.argv[1], encoding='utf-8') as plan_file: - plan = json.load(plan_file) - assert len(plan['Packages']) == 1, plan - package = plan['Packages'][0] - assert package['PackageId'] == 'Fixture', package - assert package['ProjectPath'] == 'src/Fixture/Fixture.csproj', package - assert package['Version'] == '0.1.0', package - assert package['Reasons'] == [{'Type': 'InitialRelease'}], package - PY + jq -e ' + .Packages | length == 1 and + .[0].PackageId == "Fixture" and + .[0].ProjectPath == "src/Fixture/Fixture.csproj" and + .[0].Version == "0.1.0" and + .[0].Reasons == [{"Type": "InitialRelease"}] + ' "$fixture/plan.json"