Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Commit 7d156f3

Browse files
committed
Refactor HuggingFace workflows and remove Common project dependencies; add HuggingFace release workflow and update documentation for NuGet release process.
1 parent 45e292b commit 7d156f3

6 files changed

Lines changed: 755 additions & 55 deletions

File tree

.github/workflows/hf-rc.yml

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ jobs:
260260
}
261261
262262
const packageNames = [
263-
'ErgoX.TokenX.Common',
264263
'ErgoX.TokenX.HuggingFace',
265264
'ErgoX.TokenX.HuggingFace.Runtime.Mac',
266265
'ErgoX.TokenX.HuggingFace.Runtime.Android',
@@ -620,6 +619,7 @@ jobs:
620619
RC_TAG: ${{ needs.prepare.outputs.rc_tag }}
621620
RC_NUMBER: ${{ needs.prepare.outputs.rc_number }}
622621
WORKFLOW_HEAD_SHA: ${{ needs.prepare.outputs.head_sha }}
622+
ASSEMBLY_VERSION: ${{ format('{0}.0', needs.prepare.outputs.version) }}
623623
steps:
624624
- name: Checkout repository
625625
uses: actions/checkout@v4
@@ -720,25 +720,13 @@ jobs:
720720
mkdir -p "$target_dir"
721721
rm -f "$target_dir"/*
722722
723-
# Extract the RID from runtime_dir (e.g., "linux-x64/native" -> "linux-x64")
724-
local rid="${runtime_dir%%/*}"
725-
726-
# Try to find files in the extracted/{rid}/native/ structure first (from bridge artifacts)
727-
# If not found, fall back to flat structure in extracted/ root
728-
local source_dir=""
729-
if [ -d "$extract_dir/$rid/native" ]; then
730-
source_dir="$extract_dir/$rid/native"
731-
elif [ -d "$extract_dir/native" ]; then
732-
source_dir="$extract_dir/native"
733-
else
734-
source_dir="$extract_dir"
735-
fi
736-
723+
# Bridge artifacts are packaged flat (all files directly in archive root)
724+
# Copy all files from extract_dir root only, ignoring any subdirectories
737725
local copied=0
738726
while IFS= read -r file; do
739727
cp -f "$file" "$target_dir/"
740728
copied=1
741-
done < <(find "$source_dir" -maxdepth 1 -type f)
729+
done < <(find "$extract_dir" -maxdepth 1 -type f)
742730
743731
if [ "$copied" -eq 0 ]; then
744732
echo "No runtime files copied into ${target_dir}." >&2
@@ -760,37 +748,20 @@ jobs:
760748
mkdir -p artifacts/coverage
761749
mkdir -p artifacts/packages
762750
763-
- name: Restore Common project
764-
run: dotnet restore src/Common/ErgoX.TokenX.Common.csproj --nologo
751+
- name: Restore HuggingFace project
752+
run: dotnet restore src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj --nologo
765753

766-
- name: Build and pack Common package
767-
shell: bash
754+
- name: Build HuggingFace project
768755
run: |
769-
set -euo pipefail
770-
# Build Common project with RC version
771-
dotnet build src/Common/ErgoX.TokenX.Common.csproj \
756+
dotnet build src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj \
772757
--configuration Release \
773758
--no-restore \
774759
--nologo \
775760
/p:Version=${RC_VERSION} \
776-
/p:AssemblyVersion=${RC_VERSION} \
777-
/p:FileVersion=${RC_VERSION} \
761+
/p:AssemblyVersion=${ASSEMBLY_VERSION} \
762+
/p:FileVersion=${ASSEMBLY_VERSION} \
763+
/p:InformationalVersion=${RC_VERSION} \
778764
/p:ContinuousIntegrationBuild=true
779-
780-
# Pack Common with RC version
781-
dotnet pack src/Common/ErgoX.TokenX.Common.csproj \
782-
--configuration Release \
783-
--no-build \
784-
--output artifacts/packages \
785-
/p:PackageVersion=${RC_VERSION} \
786-
/p:Version=${RC_VERSION} \
787-
/p:ContinuousIntegrationBuild=true
788-
789-
- name: Restore HuggingFace project
790-
run: dotnet restore src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj --nologo
791-
792-
- name: Build HuggingFace project
793-
run: dotnet build src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj --configuration Release --no-restore --nologo /p:ContinuousIntegrationBuild=true
794765
795766
- name: Pack NuGet artifacts
796767
shell: bash
@@ -807,25 +778,73 @@ jobs:
807778
808779
pack_default() {
809780
rm -rf src/HuggingFace/runtimes/osx-arm64 src/HuggingFace/runtimes/osx-x64 src/HuggingFace/runtimes/android-arm64 src/HuggingFace/runtimes/ios-arm64
810-
dotnet pack src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj --configuration Release --no-build --output artifacts/packages /p:PackageVersion=${RC_VERSION} /p:Version=${RC_VERSION} /p:ContinuousIntegrationBuild=true
781+
dotnet pack src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj \
782+
--configuration Release \
783+
--no-build \
784+
--output artifacts/packages \
785+
/p:PackageVersion=${RC_VERSION} \
786+
/p:Version=${RC_VERSION} \
787+
/p:AssemblyVersion=${ASSEMBLY_VERSION} \
788+
/p:FileVersion=${ASSEMBLY_VERSION} \
789+
/p:InformationalVersion=${RC_VERSION} \
790+
/p:ContinuousIntegrationBuild=true
811791
restore_runtimes
812792
}
813793
814794
pack_mac() {
815795
rm -rf src/HuggingFace/runtimes/linux-x64 src/HuggingFace/runtimes/win-x64 src/HuggingFace/runtimes/android-arm64 src/HuggingFace/runtimes/ios-arm64
816-
dotnet pack src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj --configuration Release --no-build --output artifacts/packages /p:PackageId=ErgoX.TokenX.HuggingFace.Runtime.Mac /p:PackageVersion=${RC_VERSION} /p:Version=${RC_VERSION} /p:IncludeBuildOutput=false /p:IncludeSymbols=false /p:IncludeEmptyNet8Lib=true /p:ContinuousIntegrationBuild=true
796+
dotnet pack src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj \
797+
--configuration Release \
798+
--no-build \
799+
--output artifacts/packages \
800+
/p:PackageId=ErgoX.TokenX.HuggingFace.Runtime.Mac \
801+
/p:PackageVersion=${RC_VERSION} \
802+
/p:Version=${RC_VERSION} \
803+
/p:AssemblyVersion=${ASSEMBLY_VERSION} \
804+
/p:FileVersion=${ASSEMBLY_VERSION} \
805+
/p:InformationalVersion=${RC_VERSION} \
806+
/p:IncludeBuildOutput=false \
807+
/p:IncludeSymbols=false \
808+
/p:IncludeEmptyNet8Lib=true \
809+
/p:ContinuousIntegrationBuild=true
817810
restore_runtimes
818811
}
819812
820813
pack_android() {
821814
rm -rf src/HuggingFace/runtimes/linux-x64 src/HuggingFace/runtimes/win-x64 src/HuggingFace/runtimes/osx-arm64 src/HuggingFace/runtimes/osx-x64 src/HuggingFace/runtimes/ios-arm64
822-
dotnet pack src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj --configuration Release --no-build --output artifacts/packages /p:PackageId=ErgoX.TokenX.HuggingFace.Runtime.Android /p:PackageVersion=${RC_VERSION} /p:Version=${RC_VERSION} /p:IncludeBuildOutput=false /p:IncludeSymbols=false /p:IncludeEmptyNet8Lib=true /p:ContinuousIntegrationBuild=true
815+
dotnet pack src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj \
816+
--configuration Release \
817+
--no-build \
818+
--output artifacts/packages \
819+
/p:PackageId=ErgoX.TokenX.HuggingFace.Runtime.Android \
820+
/p:PackageVersion=${RC_VERSION} \
821+
/p:Version=${RC_VERSION} \
822+
/p:AssemblyVersion=${ASSEMBLY_VERSION} \
823+
/p:FileVersion=${ASSEMBLY_VERSION} \
824+
/p:InformationalVersion=${RC_VERSION} \
825+
/p:IncludeBuildOutput=false \
826+
/p:IncludeSymbols=false \
827+
/p:IncludeEmptyNet8Lib=true \
828+
/p:ContinuousIntegrationBuild=true
823829
restore_runtimes
824830
}
825831
826832
pack_ios() {
827833
rm -rf src/HuggingFace/runtimes/linux-x64 src/HuggingFace/runtimes/win-x64 src/HuggingFace/runtimes/osx-arm64 src/HuggingFace/runtimes/osx-x64 src/HuggingFace/runtimes/android-arm64
828-
dotnet pack src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj --configuration Release --no-build --output artifacts/packages /p:PackageId=ErgoX.TokenX.HuggingFace.Runtime.iOS /p:PackageVersion=${RC_VERSION} /p:Version=${RC_VERSION} /p:IncludeBuildOutput=false /p:IncludeSymbols=false /p:IncludeEmptyNet8Lib=true /p:ContinuousIntegrationBuild=true
834+
dotnet pack src/HuggingFace/ErgoX.TokenX.HuggingFace.csproj \
835+
--configuration Release \
836+
--no-build \
837+
--output artifacts/packages \
838+
/p:PackageId=ErgoX.TokenX.HuggingFace.Runtime.iOS \
839+
/p:PackageVersion=${RC_VERSION} \
840+
/p:Version=${RC_VERSION} \
841+
/p:AssemblyVersion=${ASSEMBLY_VERSION} \
842+
/p:FileVersion=${ASSEMBLY_VERSION} \
843+
/p:InformationalVersion=${RC_VERSION} \
844+
/p:IncludeBuildOutput=false \
845+
/p:IncludeSymbols=false \
846+
/p:IncludeEmptyNet8Lib=true \
847+
/p:ContinuousIntegrationBuild=true
829848
restore_runtimes
830849
}
831850

0 commit comments

Comments
 (0)