Skip to content

Commit

Permalink
Update CI workflow and packaging script to handle empty NuGet output …
Browse files Browse the repository at this point in the history
…files and adjust CI_TAG assignment

- Modify CI workflow to set CI_TAG to "vTEST" if github.ref_name is not defined.
- Change condition for creating NuGet package to check for 'musl' in matrix.target.
- Enhance pack.sh script to verify that the NuGet output file is not empty, exiting with an error if it is.
  • Loading branch information
lilith committed Jan 21, 2025
1 parent 2076a2e commit 5eb1143
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,18 +375,18 @@ jobs:
shell: bash
run: ./ci/pack_nuget/pack.sh tool
env:
CI_TAG: ${{ github.ref_name }}
CI_TAG: ${{ github.ref_name || "vTEST" }}
PACKAGE_SUFFIX: ${{ matrix.suffix }}
NUGET_RUNTIME: ${{ matrix.nuget-rid }}
REPO_NAME: ${{ env.GITHUB_REPOSITORY_OWNER }}\/${{ env.GITHUB_REPOSITORY_NAME }}
BINARIES_DIR: "${{ env.REL_BINARIES_DIR }}"

- name: "Create NuGet Package Imageflow.NativeRuntime.${{ matrix.nuget-rid }}"
if: ${{ matrix.build-exclude != 'imageflow_abi' }}
if: ${{ contains(matrix.target, 'musl') }}
shell: bash
run: ./ci/pack_nuget/pack.sh
env:
CI_TAG: ${{ github.ref_name }}
CI_TAG: ${{ github.ref_name || "vTEST" }}
PACKAGE_SUFFIX: ${{ matrix.suffix }}
NUGET_RUNTIME: ${{ matrix.nuget-rid }}
REPO_NAME: ${{ env.GITHUB_REPOSITORY_OWNER }}\/${{ env.GITHUB_REPOSITORY_NAME }}
Expand Down
7 changes: 7 additions & 0 deletions ci/pack_nuget/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ mkdir -p "$STAGING_DIR" || true

rm "${NUGET_OUTPUT_FILE}" || true
zip -r "${NUGET_OUTPUT_FILE}" . || 7z a -tzip "${NUGET_OUTPUT_FILE}" "*" || powershell.exe -ExecutionPolicy Bypass -File "${SCRIPT_DIR}/zip.ps1" "${NUGET_OUTPUT_FILE}" "*"

# verify file is not empty
if [[ ! -s "${NUGET_OUTPUT_FILE}" ]]; then
echo "Error: ${NUGET_OUTPUT_FILE} is empty"
exit 1
fi

echo "${NUGET_OUTPUT_FILE} packed"

)

0 comments on commit 5eb1143

Please sign in to comment.