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..7184b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,37 @@ 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" + 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"