[deps]: Update nuget minor #511
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| build-self-contained: | |
| name: Build Self Contained Artifacts | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - rid: win-x64 | |
| - rid: win-x86 | |
| - rid: win-arm64 | |
| - rid: linux-x64 | |
| - rid: linux-arm | |
| - rid: linux-arm64 | |
| - rid: linux-musl-x64 | |
| - rid: linux-musl-arm64 | |
| - rid: osx-x64 | |
| - rid: osx-arm64 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0 | |
| with: | |
| dotnet-version: "10.0.x" | |
| cache: true | |
| cache-dependency-path: src/Handlebars.conf/Handlebars.conf.csproj | |
| - name: Print environment | |
| run: | | |
| dotnet --info | |
| echo "GitHub ref: $GITHUB_REF" | |
| echo "GitHub ref name: $GITHUB_REF_NAME" | |
| echo "GitHub event: $GITHUB_EVENT_NAME" | |
| - name: Build Self Contained Binary | |
| env: | |
| RID: ${{ matrix.rid }} | |
| run: | | |
| OUTPUT_DIR="$(pwd)/build/sc/$RID" | |
| echo "### Building self contained binary for $RID to $OUTPUT_DIR" | |
| dotnet publish -c Release -r "$RID" --self-contained true -p:"PublishDir=$OUTPUT_DIR" -p:PublishReadyToRun=true \ | |
| -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false \ | |
| -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=true | |
| cd "$OUTPUT_DIR" | |
| FILENAME=$(ls hbs*) | |
| SUFFIX=${FILENAME#hbs} | |
| NEW_FILENAME="hbs_${RID}${SUFFIX}" | |
| mv -- "$FILENAME" "$NEW_FILENAME" | |
| zip -j "hbs_${RID}.zip" "$NEW_FILENAME" | |
| rm "$NEW_FILENAME" | |
| - name: Upload Self Contained artifact (${{ matrix.rid }}) | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: hbs_${{ matrix.rid }} | |
| path: build/sc/${{ matrix.rid }} | |
| if-no-files-found: error | |
| - name: Build Framework Dependent Binary | |
| env: | |
| RID: ${{ matrix.rid }} | |
| run: | | |
| OUTPUT_DIR="$(pwd)/build/fd/$RID" | |
| echo "### Building framework dependent binary for $RID to $OUTPUT_DIR" | |
| dotnet publish -c Release -r "$RID" --self-contained false -p:"PublishDir=$OUTPUT_DIR" -p:PublishSingleFile=true \ | |
| -p:DebugType=None -p:DebugSymbols=false -p:IncludeNativeLibrariesForSelfExtract=true | |
| cd "$OUTPUT_DIR" | |
| FILENAME=$(ls hbs*) | |
| SUFFIX=${FILENAME#hbs} | |
| NEW_FILENAME="hbs_${RID}_dotnet${SUFFIX}" | |
| mv -- "$FILENAME" "$NEW_FILENAME" | |
| zip -j "hbs_${RID}_dotnet.zip" "$NEW_FILENAME" | |
| rm "$NEW_FILENAME" | |
| - name: Upload Framework Dependent artifact (${{ matrix.rid }}) | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: hbs_${{ matrix.rid }}_dotnet | |
| path: build/fd/${{ matrix.rid }} | |
| if-no-files-found: error | |
| - name: Smoke test linux-x64 binaries against consumer fixtures | |
| if: matrix.rid == 'linux-x64' | |
| env: | |
| RID: ${{ matrix.rid }} | |
| run: | | |
| for kind in sc fd; do | |
| zip_name="hbs_${RID}.zip" | |
| [[ "$kind" == "fd" ]] && zip_name="hbs_${RID}_dotnet.zip" | |
| workdir=$(mktemp -d) | |
| unzip -j "build/${kind}/${RID}/${zip_name}" -d "$workdir" | |
| chmod +x "$workdir"/hbs_* | |
| HBS_BIN="$(ls "$workdir"/hbs_*)" ./test/run-fixtures.sh | |
| done |