Skip to content

Update for automatic version bump calculation #150

Update for automatic version bump calculation

Update for automatic version bump calculation #150

Workflow file for this run

---
name: Build
on:
pull_request:
push:
workflow_dispatch:
jobs:
build-self-contained:
name: Build Self Contained Artifacts
runs-on: ubuntu-22.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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- 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: Restore/Clean service
run: |
echo "Restore"
dotnet restore
echo "Clean"
dotnet clean -c "Release"
- 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: hbs_${{ matrix.rid }}_dotnet
path: build/fd/${{ matrix.rid }}
if-no-files-found: error