From 5581fd5bd312347c13936ae58e5b9b39caaa3bb5 Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 04:28:58 +0800 Subject: [PATCH 01/15] Simplify build configuration and add CI/CD documentation - Set conditional default version to 1.0.0-dev - Streamline package release notes - Remove debug version suffix configuration - Add automated build and release workflow documentation - Document manual build process with native library steps --- .github/workflows/ci.yml | 115 +++++++++++++++++++++++++++++++++++++++ Directory.Build.props | 18 ++---- README.md | 30 ++++++++++ artifacts/.gitkeep | 0 4 files changed, 149 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 artifacts/.gitkeep diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..93efaaa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,115 @@ +name: CI/CD + +on: + pull_request: + branches: [ main ] + push: + tags: [ 'v*' ] + +jobs: + build-native: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + rid: linux-x64 + - os: macos-latest + rid: osx-arm64 + - os: windows-latest + rid: win-x64 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Build Native Libraries + run: | + cd tree-sitter + make clean && make + shell: bash + + - name: Copy Native Files + run: | + mkdir -p TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native + cp -r tree-sitter/dist/* TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ + shell: bash + + - name: Upload Native Artifacts + uses: actions/upload-artifact@v4 + with: + name: native-${{ matrix.rid }} + path: TypeScriptParser.Native/runtimes/${{ matrix.rid }}/ + retention-days: 1 + + build-and-test: + needs: build-native + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Download Native Artifacts + uses: actions/download-artifact@v4 + with: + pattern: native-* + path: TypeScriptParser.Native/runtimes/ + merge-multiple: true + + - name: Set Version + run: | + if [[ $GITHUB_REF == refs/tags/v* ]]; then + TAG=${GITHUB_REF#refs/tags/v} + VERSION="${TAG}.${{ github.run_number }}" + else + VERSION="1.0.0-pr${{ github.event.number }}.${{ github.run_number }}" + fi + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build -c Release -p:Version=$VERSION --no-restore + + - name: Test + run: dotnet test -c Release --no-build + + - name: Pack + run: dotnet pack -c Release -p:Version=$VERSION --no-build -o ./artifacts + + - name: Upload Packages + uses: actions/upload-artifact@v4 + with: + name: nuget-packages + path: artifacts/*.nupkg + + publish: + needs: build-and-test + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - name: Download Packages + uses: actions/download-artifact@v4 + with: + name: nuget-packages + path: artifacts/ + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Publish to NuGet + run: | + dotnet nuget push artifacts/*.nupkg \ + --api-key ${{ secrets.NUGET_API_KEY }} \ + --source https://api.nuget.org/v3/index.json \ + --skip-duplicate \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 8717698..d909beb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,12 +1,12 @@ - - 1.0.0 + + 1.0.0-dev 1.0.0 1.0.0 - + TypeScriptParser Team TypeScriptParser Copyright © $(Company) $([System.DateTime]::Now.Year) @@ -14,12 +14,7 @@ https://github.com/your-org/csharp-tree-sitter https://github.com/your-org/csharp-tree-sitter git - -基于Tree-sitter的TypeScript解析器 -- 支持跨平台Native库自动管理 -- 零配置用户体验 -- 支持主流平台: Linux-x64, macOS-ARM64, Win-x64 - + 基于Tree-sitter的TypeScript解析器 - 支持跨平台Native库自动管理 latest @@ -27,9 +22,4 @@ true - - - debug - - \ No newline at end of file diff --git a/README.md b/README.md index 4bc156f..9f70615 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,36 @@ dotnet test --configuration Release --no-build dotnet pack -c Release --no-build -o ./artifacts ``` +## 自动化构建 + +### 开发流程 +1. 创建功能分支 +2. 提交Pull Request → 自动构建测试 +3. 合并到main分支 + +### 发布流程 +1. 创建版本标签:`git tag v1.2.0 && git push origin v1.2.0` +2. 自动构建测试发布到NuGet.org +3. 版本号格式:`1.2.0.{构建号}` + +## 手动构建 + +```bash +# 1. 构建native库 +(cd tree-sitter/ && make clean && make) + +# 2. 复制运行时文件 +RID=$(dotnet --info | grep "RID:" | awk '{print $2}') +mkdir -p TypeScriptParser.Native/runtimes/$RID/native +cp -r tree-sitter/dist/* TypeScriptParser.Native/runtimes/$RID/native/ + +# 3. .NET构建 +dotnet restore +dotnet build -c Release +dotnet test --configuration Release --no-build +dotnet pack -c Release --no-build -o ./artifacts +``` + ## 开发构建 ```bash diff --git a/artifacts/.gitkeep b/artifacts/.gitkeep new file mode 100644 index 0000000..e69de29 From 7d75b94ea1ab041f5690b1d530e4ce18216990fc Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 04:48:51 +0800 Subject: [PATCH 02/15] Add debug logging and fix artifact path in CI workflow - Add file listing to verify native library copying - Fix upload artifact path to include native/ subdirectory --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93efaaa..43cf708 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,13 +34,15 @@ jobs: run: | mkdir -p TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native cp -r tree-sitter/dist/* TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ + echo "Files copied for ${{ matrix.rid }}:" + ls -la TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ shell: bash - name: Upload Native Artifacts uses: actions/upload-artifact@v4 with: name: native-${{ matrix.rid }} - path: TypeScriptParser.Native/runtimes/${{ matrix.rid }}/ + path: TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ retention-days: 1 build-and-test: From b69abce83db1214b25c7556f26a6d49853b9ac17 Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 04:56:29 +0800 Subject: [PATCH 03/15] Add debug logging for runtime files in CI workflow Add debugging steps to inspect runtime files structure and test output directory before running tests to help diagnose CI issues. --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43cf708..d9d914f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,14 @@ jobs: - name: Build run: dotnet build -c Release -p:Version=$VERSION --no-restore + - name: Debug Runtime Files Before Test + run: | + echo "=== Runtime files structure ===" + find ./TypeScriptParser.Native/runtimes/ -type f + + echo "=== Test output directory before testing ===" + ls -la TypeScriptParser.Tests/bin/Release/net9.0/ || echo "Test output directory not found" + - name: Test run: dotnet test -c Release --no-build From a609ef9fe03b3bc59047a3a3321387795f381cb6 Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 05:02:00 +0800 Subject: [PATCH 04/15] Fix artifact upload path in CI workflow Remove '/native/' suffix from artifact path to correctly upload the entire runtime directory structure. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9d914f..c88ff44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: native-${{ matrix.rid }} - path: TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ + path: TypeScriptParser.Native/runtimes/${{ matrix.rid }}/ retention-days: 1 build-and-test: From 1aec0df7de76ca4655d0befd800df5dea2025db6 Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 05:08:24 +0800 Subject: [PATCH 05/15] Add debug output for native runtime directory path Show the directory path before listing contents to improve CI debugging --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c88ff44..ee4f34d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,7 @@ jobs: mkdir -p TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native cp -r tree-sitter/dist/* TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ echo "Files copied for ${{ matrix.rid }}:" + echo TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ ls -la TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ shell: bash From a0f34632df5f232da37ead07b72700a1a0249e4e Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 05:13:58 +0800 Subject: [PATCH 06/15] Fix artifact upload path in CI workflow Remove matrix.rid from artifact path to upload entire runtimes directory --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee4f34d..f43d145 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: native-${{ matrix.rid }} - path: TypeScriptParser.Native/runtimes/${{ matrix.rid }}/ + path: TypeScriptParser.Native/runtimes/ retention-days: 1 build-and-test: From 619006f41bbb7e346fc86a300e3fbd7914b67d1d Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 05:27:20 +0800 Subject: [PATCH 07/15] Consolidate CI workflow jobs and move testing to build-native job - Merge build-and-test and publish jobs into pack-and-publish - Move .NET build and test steps to build-native job for better parallelization - Add conditional publishing based on tag presence - Remove redundant debug steps from pack-and-publish job --- .github/workflows/ci.yml | 56 ++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f43d145..f3708fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,9 +35,30 @@ jobs: mkdir -p TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native cp -r tree-sitter/dist/* TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ echo "Files copied for ${{ matrix.rid }}:" - echo TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ - ls -la TypeScriptParser.Native/runtimes/${{ matrix.rid }}/native/ shell: bash + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build -c Release --no-restore + + - name: Debug Runtime Files Before Test + run: | + echo "=== Runtime files structure ===" + find ./TypeScriptParser.Native/runtimes/ -type f + + echo "=== Test output directory before testing ===" + ls -la TypeScriptParser.Tests/bin/Release/net9.0/ || echo "Test output directory not found" + shell: bash + + - name: Test + run: dotnet test -c Release --no-build - name: Upload Native Artifacts uses: actions/upload-artifact@v4 @@ -46,7 +67,7 @@ jobs: path: TypeScriptParser.Native/runtimes/ retention-days: 1 - build-and-test: + pack-and-publish: needs: build-native runs-on: ubuntu-latest @@ -81,17 +102,6 @@ jobs: - name: Build run: dotnet build -c Release -p:Version=$VERSION --no-restore - - name: Debug Runtime Files Before Test - run: | - echo "=== Runtime files structure ===" - find ./TypeScriptParser.Native/runtimes/ -type f - - echo "=== Test output directory before testing ===" - ls -la TypeScriptParser.Tests/bin/Release/net9.0/ || echo "Test output directory not found" - - - name: Test - run: dotnet test -c Release --no-build - - name: Pack run: dotnet pack -c Release -p:Version=$VERSION --no-build -o ./artifacts @@ -100,25 +110,9 @@ jobs: with: name: nuget-packages path: artifacts/*.nupkg - - publish: - needs: build-and-test - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') - - steps: - - name: Download Packages - uses: actions/download-artifact@v4 - with: - name: nuget-packages - path: artifacts/ - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '9.0.x' - name: Publish to NuGet + if: startsWith(github.ref, 'refs/tags/v') run: | dotnet nuget push artifacts/*.nupkg \ --api-key ${{ secrets.NUGET_API_KEY }} \ From 2757bf6860f53fb08ce2991bdfbf4a5b5990cfaa Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 05:38:27 +0800 Subject: [PATCH 08/15] Fix library naming for cross-platform compatibility Add LIB_PREFIX variable to handle different library naming conventions between Windows (no prefix) and Unix-like systems (lib prefix). --- tree-sitter/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tree-sitter/Makefile b/tree-sitter/Makefile index 2f5386f..9d8f81a 100644 --- a/tree-sitter/Makefile +++ b/tree-sitter/Makefile @@ -18,14 +18,17 @@ ifeq ($(UNAME_S),Darwin) endif ifeq ($(OS),Windows_NT) LIB_EXT=.dll + LIB_PREFIX= +else + LIB_PREFIX=lib endif ifndef LIB_EXT LIB_EXT=.so endif LIBS=\ - $(BIN)/libtree-sitter$(LIB_EXT) \ - $(BIN)/libtree-sitter-typescript$(LIB_EXT) \ + $(BIN)/$(LIB_PREFIX)tree-sitter$(LIB_EXT) \ + $(BIN)/$(LIB_PREFIX)tree-sitter-typescript$(LIB_EXT) \ all: dirs $(LIBS) @@ -56,7 +59,7 @@ $(BIN)/tree-sitter.obj: \ -Itree-sitter/lib/src -Itree-sitter/lib/src/unicode \ -c tree-sitter/lib/src/lib.c -$(BIN)/libtree-sitter$(LIB_EXT): $(BIN)/tree-sitter.obj +$(BIN)/$(LIB_PREFIX)tree-sitter$(LIB_EXT): $(BIN)/tree-sitter.obj gcc $(LFLAGS) $(CFLAGS) -o $@ $^ @@ -70,7 +73,7 @@ $(BIN)/tree-sitter-typescript-parser.obj: tree-sitter-typescript/typescript/src/ $(BIN)/tree-sitter-typescript-scanner.obj: tree-sitter-typescript/typescript/src/scanner.c gcc $(CFLAGS) -o $@ -Itree-sitter-typescript/typescript/src -c $^ -$(BIN)/libtree-sitter-typescript$(LIB_EXT): $(BIN)/tree-sitter-typescript-parser.obj $(BIN)/tree-sitter-typescript-scanner.obj +$(BIN)/$(LIB_PREFIX)tree-sitter-typescript$(LIB_EXT): $(BIN)/tree-sitter-typescript-parser.obj $(BIN)/tree-sitter-typescript-scanner.obj gcc $(LFLAGS) $(CFLAGS) -o $@ $^ ######## From c99787d0063895aaabb554698705813c6599f88a Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 07:22:45 +0800 Subject: [PATCH 09/15] ci: add cross-platform package testing job to CI workflow Add package-test job that runs after pack-and-publish to test the published NuGet package on Linux, macOS, and Windows. The job downloads the published package artifacts, updates the test project to use the specific version, and runs tests to ensure package functionality across all platforms. Also updates default version to 0.0.1-dev for initial development builds. --- .github/workflows/ci.yml | 51 ++++++++++++++++++- Directory.Build.props | 2 +- .../TypeScriptParser.TestPackage.csproj | 2 +- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3708fa..af83dce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,4 +117,53 @@ jobs: dotnet nuget push artifacts/*.nupkg \ --api-key ${{ secrets.NUGET_API_KEY }} \ --source https://api.nuget.org/v3/index.json \ - --skip-duplicate \ No newline at end of file + --skip-duplicate + + package-test: + needs: pack-and-publish + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + rid: linux-x64 + - os: macos-latest + rid: osx-arm64 + - os: windows-latest + rid: win-x64 + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Download NuGet Packages + uses: actions/download-artifact@v4 + with: + name: nuget-packages + path: ./artifacts + + - name: Set Version + run: | + if [[ $GITHUB_REF == refs/tags/v* ]]; then + TAG=${GITHUB_REF#refs/tags/v} + VERSION="${TAG}.${{ github.run_number }}" + else + VERSION="1.0.0-pr${{ github.event.number }}.${{ github.run_number }}" + fi + echo "VERSION=$VERSION" >> $GITHUB_ENV + shell: bash + + - name: Update Package Reference + run: | + cd TypeScriptParser.TestPackage + dotnet remove package TypeScriptParser + dotnet add package TypeScriptParser --version $VERSION --source local + shell: bash + + - name: Test Package + run: dotnet test TypeScriptParser.TestPackage/ -c Release + shell: bash \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index d909beb..16d4d66 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ - 1.0.0-dev + 0.0.1-dev 1.0.0 1.0.0 diff --git a/TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj b/TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj index 6f37c35..b8d1e63 100644 --- a/TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj +++ b/TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj @@ -10,7 +10,7 @@ - + From 9b4907579291514d0c49045acad5aeb67a37bfca Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 07:31:10 +0800 Subject: [PATCH 10/15] ci: refactor publish job to run after package testing Move NuGet publishing from pack-and-publish job to separate publish job that runs after package-test job completes. This ensures packages are thoroughly tested across all platforms before being published to NuGet. --- .github/workflows/ci.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af83dce..dafef29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,14 +110,6 @@ jobs: with: name: nuget-packages path: artifacts/*.nupkg - - - name: Publish to NuGet - if: startsWith(github.ref, 'refs/tags/v') - run: | - dotnet nuget push artifacts/*.nupkg \ - --api-key ${{ secrets.NUGET_API_KEY }} \ - --source https://api.nuget.org/v3/index.json \ - --skip-duplicate package-test: needs: pack-and-publish @@ -166,4 +158,23 @@ jobs: - name: Test Package run: dotnet test TypeScriptParser.TestPackage/ -c Release - shell: bash \ No newline at end of file + shell: bash + + publish: + needs: package-test + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - name: Download NuGet Packages + uses: actions/download-artifact@v4 + with: + name: nuget-packages + path: ./artifacts + + - name: Publish to NuGet + run: | + dotnet nuget push artifacts/*.nupkg \ + --api-key ${{ secrets.NUGET_API_KEY }} \ + --source https://api.nuget.org/v3/index.json \ + --skip-duplicate \ No newline at end of file From 3ff96415ffd68fb1c6ebbc433f7d37b5f65ee46b Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 07:45:15 +0800 Subject: [PATCH 11/15] ci: fix dotnet command paths in package testing workflow The dotnet remove and add commands now specify the full project file path instead of changing directories, making the commands more explicit and avoiding potential path-related issues in the CI environment. --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dafef29..80c85cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,9 +151,8 @@ jobs: - name: Update Package Reference run: | - cd TypeScriptParser.TestPackage - dotnet remove package TypeScriptParser - dotnet add package TypeScriptParser --version $VERSION --source local + dotnet remove TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj package TypeScriptParser + dotnet add TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj package TypeScriptParser --version $VERSION --source local shell: bash - name: Test Package From 2809506d6b64ac9238dbee3e1aee62ca8ed1412f Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 07:52:02 +0800 Subject: [PATCH 12/15] ci: update package source from 'local' to './artifacts' Change the dotnet package source reference in CI workflow to use the more explicit './artifacts' path instead of 'local'. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80c85cc..6f3144c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,7 +152,7 @@ jobs: - name: Update Package Reference run: | dotnet remove TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj package TypeScriptParser - dotnet add TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj package TypeScriptParser --version $VERSION --source local + dotnet add TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj package TypeScriptParser --version $VERSION --source ./artifacts shell: bash - name: Test Package From d310ce8b83fe2e57452f83a56a24b3b0fb627c2a Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 07:57:23 +0800 Subject: [PATCH 13/15] Add dotnet restore step before testing package in CI This ensures dependencies are properly restored before running tests on the TypeScriptParser.TestPackage, preventing potential build failures due to missing dependencies. --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f3144c..abbb513 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,6 +155,10 @@ jobs: dotnet add TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj package TypeScriptParser --version $VERSION --source ./artifacts shell: bash + - name: Restore Dependencies + run: dotnet restore TypeScriptParser.TestPackage/ + shell: bash + - name: Test Package run: dotnet test TypeScriptParser.TestPackage/ -c Release shell: bash From c8856bb1c6ad327f9b114b37a467877645187a6a Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 08:05:24 +0800 Subject: [PATCH 14/15] ci: reorder dependencies restoration before package update Move dotnet restore step to execute before package reference update to ensure dependencies are available when updating package references in the CI workflow. --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abbb513..8a3a383 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,16 +149,16 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV shell: bash + - name: Restore Dependencies + run: dotnet restore TypeScriptParser.TestPackage/ + shell: bash + - name: Update Package Reference run: | dotnet remove TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj package TypeScriptParser dotnet add TypeScriptParser.TestPackage/TypeScriptParser.TestPackage.csproj package TypeScriptParser --version $VERSION --source ./artifacts shell: bash - - name: Restore Dependencies - run: dotnet restore TypeScriptParser.TestPackage/ - shell: bash - - name: Test Package run: dotnet test TypeScriptParser.TestPackage/ -c Release shell: bash From 124aff16467b9006dd5f5ef7c7db58c64303d4a3 Mon Sep 17 00:00:00 2001 From: s97712 Date: Sun, 24 Aug 2025 08:13:09 +0800 Subject: [PATCH 15/15] Simplify macOS runtime identifier to use osx-arm64 only Remove architecture-specific detection for macOS and default to ARM64, consolidating the two conditional statements into one. --- TypeScriptParser.Native/build/TypeScriptParser.Native.props | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TypeScriptParser.Native/build/TypeScriptParser.Native.props b/TypeScriptParser.Native/build/TypeScriptParser.Native.props index 62a8acd..648a052 100644 --- a/TypeScriptParser.Native/build/TypeScriptParser.Native.props +++ b/TypeScriptParser.Native/build/TypeScriptParser.Native.props @@ -16,8 +16,7 @@ win-x64 win-x86 linux-x64 - osx-x64 - osx-arm64 + osx-arm64 win-x64