Skip to content

Commit

Permalink
Properly manage the version
Browse files Browse the repository at this point in the history
  • Loading branch information
sappho192 committed Jun 18, 2024
1 parent f553a0d commit 8789b05
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 38 deletions.
2 changes: 1 addition & 1 deletion NATIVE_LIB_VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
23 changes: 22 additions & 1 deletion build_dotnet.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
Push-Location
# Step 1: Read the version from VERSION.txt
$version = Get-Content -Path ".\NATIVE_LIB_VERSION.txt"
Write-Output "Version: $version"

# Step 3: Replace the version in.nuspec file
$nuspecFilePath = ".\nuget\Tokenizers.DotNet.nuspec"
$nuspecContent = Get-Content -Path $nuspecFilePath
$nuspecContent = $nuspecContent -replace '(?<=<version>)[^<]*', $version
Set-Content -Path $nuspecFilePath -Value $nuspecContent
Write-Output "Updated version in nuspec file"

Pop-Location
Push-Location

Set-Location -Path ".\dotnet\Tokenizers.DotNet"
dotnet build --configuration Release
Copy-Item "bin\Release\Tokenizers.DotNet.*.nupkg" "..\..\nuget"
if ($LASTEXITCODE -ne 0) {
Pop-Location
exit $LASTEXITCODE
}
# Copy-Item "bin\Release\net*" "..\..\nuget" -Force
Pop-Location

Push-Location
Set-Location -Path "nuget"
nuget pack Tokenizers.DotNet.nuspec
Pop-Location
17 changes: 15 additions & 2 deletions clear_all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ if (Test-Path -Path "hf_tokenizers.dll") {
}

Set-Location -Path ".."
if (Test-Path -Path "Tokenizers.DotNet.*") {
Remove-Item "Tokenizers.DotNet.*" -Force
if (Test-Path -Path "Tokenizers.DotNet.*.nupkg") {
Remove-Item "Tokenizers.DotNet.*.nupkg" -Force
}

if (Test-Path -Path "net*") {
Remove-Item "net*" -Force
}
Pop-Location

Push-Location
Set-Location -Path ".\dotnet\Tokenizers.DotNet"
if (Test-Path -Path ".\bin") {
Remove-Item "bin" -Force -Recurse
}
if (Test-Path -Path ".\obj") {
Remove-Item "obj" -Force -Recurse
}
Pop-Location
4 changes: 2 additions & 2 deletions dotnet/Tokenizers.DotNet/Tokenizers.DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Title>Tokenizers.DotNet</Title>
<Authors>sappho192</Authors>
<Description>.NET wrapper of HuggingFace Tokenizers library</Description>
Expand All @@ -14,7 +14,7 @@
<RepositoryType>git</RepositoryType>
<PackageTags>tokenizers;rust;huggingface;tokenizer;gpt</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<NuspecFile>Tokenizers.DotNet.nuspec</NuspecFile>
<!-- <NuspecFile>Tokenizers.DotNet.nuspec</NuspecFile> -->
</PropertyGroup>

<ItemGroup>
Expand Down
30 changes: 0 additions & 30 deletions dotnet/Tokenizers.DotNet/Tokenizers.DotNet.nuspec

This file was deleted.

2 changes: 1 addition & 1 deletion nuget/win-x64/Tokenizers.DotNet.runtime.win.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>Tokenizers.DotNet.runtime.win</id>
<version>1.0.0</version>
<version>1.0.1</version>
<title>Tokenizers.DotNet.runtime.win</title>
<authors>sappho192</authors>
<owners>sappho192</owners>
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hf_tokenizers"
version = "1.0.0"
version = "1.0.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down

0 comments on commit 8789b05

Please sign in to comment.