Browse Source

ci: fix error.

tags/v0.6.0
Yaohui Liu 2 years ago
parent
commit
53eedf1428
No known key found for this signature in database GPG Key ID: E86D01E1809BD23E
3 changed files with 30 additions and 13 deletions
  1. +22
    -9
      .github/prepare_release.sh
  2. +1
    -4
      .github/workflows/release.yml
  3. +7
    -0
      LLama/runtimes/build/temp.csproj

+ 22
- 9
.github/prepare_release.sh View File

@@ -1,6 +1,5 @@
version="$1" # version is in format "A.B.C"
is_minor="$2" # type is "minor" or "patch"
is_patch="$3" # type is "minor" or "patch"
is_minor="$1" # type is "minor" or "patch"
is_patch="$2" # type is "minor" or "patch"

echo "is_minor: $is_minor"
echo "is_patch: $is_patch"
@@ -18,6 +17,26 @@ else
echo "At least one of minor version and patch version should be specified."
fi

# preparation before packing backends
mkdir ./temp
mkdir ./temp/runtimes
cp ./LLama/runtimes/*.* ./temp/runtimes/
cp ./LLama/runtimes/build/*/* ./temp/

# get the current version
cd temp
dotnet add package LLamaSharp
version=$(dotnet list temp.csproj package | grep LLamaSharp)
regex="[0-9]+\.[0-9]+\.[0-9]+$"
if [[ $version =~ $regex ]]; then
version="${BASH_REMATCH[0]}"
echo "Extracted version: $version"
else
echo "No matching version found"
exit 1
fi

# update the version
if [[ $type == "minor" ]]; then
regex="[0-9]+\.([0-9]+)\.[0-9]+$"
if [[ $version =~ $regex ]]; then
@@ -54,12 +73,6 @@ else
exit 1
fi

# preparation before packing backends
mkdir ./temp
mkdir ./temp/runtimes
cp ./LLama/runtimes/*.* ./temp/runtimes/
cp -r ./LLama/runtimes/build ./temp/

# pack the main package
dotnet pack ./LLama/LLamaSharp.csproj -c Release -o ./temp/ /p:PackageVersion=$updated_version /p:Version=$updated_version;
dotnet pack ./LLama.SemanticKernel/LLamaSharp.csproj -c Release -o ./temp/ /p:PackageVersion=$updated_version /p:Version=$updated_version;


+ 1
- 4
.github/workflows/release.yml View File

@@ -42,13 +42,10 @@ jobs:
git fetch --unshallow;
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*";
git fetch origin;
LastTag=$(git describe --tags);
DroppedTag=$(echo "$LastTag" | sed 's/^v//');
echo "Last tag is: $DroppedTag";
is_minor=contains(github.event.pull_request.labels.*.name, 'minor-release')
is_patch=contains(github.event.pull_request.labels.*.name, 'patch-release')
sh ./.github/prepare_release.sh $DroppedTag $is_minor $is_patch
sh ./.github/prepare_release.sh $is_minor $is_patch

if($LastExitCode -ne 0)
{


+ 7
- 0
LLama/runtimes/build/temp.csproj View File

@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>

Loading…
Cancel
Save