99  build_and_release :
1010    strategy :
1111      matrix :
12-         os : [ubuntu-latest, macos-latest] 
12+         os : [ubuntu-latest, macos-latest, windows-latest ] 
1313        feature : [lua54, lua53, lua52, lua51, luajit] 
1414        arch : [x86_64, aarch64] 
15+         exclude :
16+           - os : windows-latest 
17+             arch : aarch64 
18+ 
1519    runs-on : ${{ matrix.os }} 
1620
1721    steps :
2024      - name : Install Rust 
2125        uses : dtolnay/rust-toolchain@stable 
2226        with :
23-           targets : ${{ matrix.arch }}-${{ matrix.os == 'ubuntu-latest' && 'unknown-linux-gnu' || ' apple-darwin' }} 
27+           targets : ${{ matrix.arch }}-${{ matrix.os == 'ubuntu-latest' && 'unknown-linux-gnu' || matrix.os == 'macos-latest' && ' apple-darwin' || 'pc-windows-msvc ' }} 
2428
2529      - name : Install cross-compilation tools (Linux ARM64) 
2630        if : matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64' 
2933          sudo apt-get install -y gcc-aarch64-linux-gnu 
3034
3135name : Build 
36+         shell : bash 
3237        run : | 
3338          if [ "${{ matrix.arch }}" == "aarch64" ]; then 
3439            if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then 
@@ -41,13 +46,17 @@ jobs:
4146          fi 
4247
4348name : Prepare artifact 
49+         shell : bash 
4450        run : | 
4551          if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then 
4652            OS="linux" 
4753            EXT="so" 
48-           else  
54+           elif [ "${{ matrix.os }}" == "macos-latest" ]; then  
4955            OS="macOS" 
5056            EXT="dylib" 
57+           else 
58+             OS="windows" 
59+             EXT="dll" 
5160          fi 
5261          ARCH="${{ matrix.arch == 'x86_64' && 'x86_64' || 'arm64' }}" 
5362          mkdir -p artifacts 
5867              cp target/aarch64-apple-darwin/release/libtiktoken_core.$EXT artifacts/tiktoken_core-$OS-$ARCH-${{ matrix.feature }}.$EXT 
5968            fi 
6069          else 
61-             cp target/release/libtiktoken_core.$EXT artifacts/tiktoken_core-$OS-$ARCH-${{ matrix.feature }}.$EXT 
70+             if [ "${{ matrix.os }}" == "windows-latest" ]; then 
71+               cp target/release/tiktoken_core.$EXT artifacts/tiktoken_core-$OS-$ARCH-${{ matrix.feature }}.$EXT 
72+             else 
73+               cp target/release/libtiktoken_core.$EXT artifacts/tiktoken_core-$OS-$ARCH-${{ matrix.feature }}.$EXT 
74+             fi 
6275          fi 
6376
6477name : Upload artifacts 
0 commit comments