V2 #399
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request_target: | |
| branches: | |
| - main | |
| permissions: write-all | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| platform: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install maturin | |
| run: uv pip install maturin --system | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Install | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cargo tarpaulin and fmt | |
| run: | | |
| cargo install cargo-tarpaulin | |
| rustup component add rustfmt clippy | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build | |
| run: bun run build | |
| - name: Lint | |
| run: bun run lint | |
| - name: Test | |
| run: bun run test | |
| - name: Upload to codecov.io | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| if: github.ref == 'refs/heads/main' | |
| dotnet-test: | |
| name: .NET Test - ${{ matrix.rid }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Windows x64 | |
| - runner: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| rid: win-x64 | |
| lib_name: braillify_native.dll | |
| # Windows x86 (32-bit) | |
| - runner: windows-latest | |
| target: i686-pc-windows-msvc | |
| rid: win-x86 | |
| lib_name: braillify_native.dll | |
| dotnet_arch: x86 | |
| # Linux x64 | |
| - runner: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| rid: linux-x64 | |
| lib_name: libbraillify_native.so | |
| # macOS arm64 (native) | |
| - runner: macos-14 | |
| target: aarch64-apple-darwin | |
| rid: osx-arm64 | |
| lib_name: libbraillify_native.dylib | |
| # macOS x64 (x64 SDK on macos-14) | |
| - runner: macos-14 | |
| target: x86_64-apple-darwin | |
| rid: osx-x64 | |
| lib_name: libbraillify_native.dylib | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: ${{ matrix.target }} | |
| - name: Build native library | |
| run: cargo build --release --target ${{ matrix.target }} -p dotnet | |
| - name: Setup .NET | |
| if: matrix.dotnet_arch != 'x86' && matrix.rid != 'osx-x64' | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 9.0.x | |
| 8.0.x | |
| - name: Setup .NET x86 | |
| if: matrix.dotnet_arch == 'x86' | |
| shell: pwsh | |
| run: | | |
| $installDir = "$env:RUNNER_TEMP\dotnet-x86" | |
| Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 | |
| ./dotnet-install.ps1 -Channel 8.0 -Architecture x86 -InstallDir $installDir | |
| ./dotnet-install.ps1 -Channel 9.0 -Architecture x86 -InstallDir $installDir | |
| ./dotnet-install.ps1 -Channel 10.0 -Architecture x86 -InstallDir $installDir -Quality preview | |
| # Add to PATH and set DOTNET_ROOT | |
| echo "$installDir" | Out-File -FilePath $env:GITHUB_PATH -Append | |
| echo "DOTNET_ROOT=$installDir" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| - name: Setup .NET x64 (macOS) | |
| if: matrix.rid == 'osx-x64' | |
| run: | | |
| export DOTNET_INSTALL_DIR="$RUNNER_TEMP/dotnet-x64" | |
| curl -sSL https://dot.net/v1/dotnet-install.sh | bash -s -- --channel 8.0 --architecture x64 --install-dir "$DOTNET_INSTALL_DIR" | |
| curl -sSL https://dot.net/v1/dotnet-install.sh | bash -s -- --channel 9.0 --architecture x64 --install-dir "$DOTNET_INSTALL_DIR" | |
| curl -sSL https://dot.net/v1/dotnet-install.sh | bash -s -- --channel 10.0 --architecture x64 --install-dir "$DOTNET_INSTALL_DIR" --quality preview | |
| echo "$DOTNET_INSTALL_DIR" >> $GITHUB_PATH | |
| echo "DOTNET_ROOT=$DOTNET_INSTALL_DIR" >> $GITHUB_ENV | |
| - name: Copy native library | |
| run: | | |
| mkdir -p packages/dotnet/BraillifyNet/runtimes/${{ matrix.rid }}/native | |
| cp target/${{ matrix.target }}/release/${{ matrix.lib_name }} packages/dotnet/BraillifyNet/runtimes/${{ matrix.rid }}/native/ | |
| shell: bash | |
| - name: Restore dependencies | |
| run: dotnet restore Braillify.Tests/Braillify.Tests.csproj | |
| working-directory: packages/dotnet | |
| - name: Build | |
| run: dotnet build --no-restore -c Release Braillify.Tests/Braillify.Tests.csproj | |
| working-directory: packages/dotnet | |
| - name: Test (.NET 8.0) | |
| run: dotnet test --no-build -c Release --verbosity normal --framework net8.0 Braillify.Tests/Braillify.Tests.csproj | |
| working-directory: packages/dotnet | |
| - name: Test (.NET 9.0) | |
| run: dotnet test --no-build -c Release --verbosity normal --framework net9.0 Braillify.Tests/Braillify.Tests.csproj | |
| working-directory: packages/dotnet | |
| deploy-landing: | |
| name: Deploy Landing | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: | |
| - test | |
| - dotnet-test | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install maturin | |
| run: uv pip install maturin --system | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Install | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - run: | | |
| bun i | |
| bun run build | |
| - run: cargo test test_by_testcase | |
| # 실패하지만 어느정도 맞았는지 알려주므로 무시해야합니다. | |
| continue-on-error: true | |
| - name: Build Landing | |
| run: bun run build:landing | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./apps/landing/out | |
| - uses: actions/deploy-pages@v4 | |
| # publish | |
| changepacks: | |
| name: changepacks | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # create pull request comments | |
| pull-requests: write | |
| # Actions > General > Workflow permissions for creating pull request | |
| # Create brench to create pull request | |
| contents: write | |
| needs: | |
| - test | |
| - dotnet-test | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: changepacks/action@main | |
| id: changepacks | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| outputs: | |
| changepacks: ${{ steps.changepacks.outputs.changepacks }} | |
| release_assets_urls: ${{ steps.changepacks.outputs.release_assets_urls }} | |
| # node | |
| node-build: | |
| needs: | |
| - test | |
| - dotnet-test | |
| - changepacks | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'packages/node/package.json') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| settings: | |
| # - host: macos-latest | |
| # target: x86_64-apple-darwin | |
| # build: bun run build --target x86_64-apple-darwin | |
| # - host: windows-latest | |
| # build: bun run build --target x86_64-pc-windows-msvc | |
| # target: x86_64-pc-windows-msvc | |
| - host: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| build: bun run build | |
| # - host: macos-latest | |
| # target: aarch64-apple-darwin | |
| # build: bun run build --target aarch64-apple-darwin | |
| name: Node Build - ${{ matrix.settings.target }} | |
| runs-on: ${{ matrix.settings.host }} | |
| env: | |
| # DEBUG: napi:* | |
| MACOSX_DEPLOYMENT_TARGET: '10.13' | |
| CARGO_INCREMENTAL: '1' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup node | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install maturin | |
| run: uv pip install maturin --system | |
| - name: Install | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| targets: ${{ matrix.settings.target }} | |
| - uses: mlugg/setup-zig@v2 | |
| if: ${{ contains(matrix.settings.target, 'musl') }} | |
| with: | |
| version: 0.14.1 | |
| - name: Install cargo-zigbuild | |
| uses: taiki-e/install-action@v2 | |
| if: ${{ contains(matrix.settings.target, 'musl') }} | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| tool: cargo-zigbuild | |
| - name: Setup toolchain | |
| run: ${{ matrix.settings.setup }} | |
| if: ${{ matrix.settings.setup }} | |
| shell: bash | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build | |
| run: ${{ matrix.settings.build }} | |
| shell: bash | |
| working-directory: packages/node | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pkg-${{ matrix.settings.target }} | |
| path: | | |
| packages/node/pkg/* | |
| if-no-files-found: error | |
| # python | |
| python-build: | |
| runs-on: ${{ matrix.runner }} | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'packages/python/pyproject.toml') }} | |
| needs: | |
| - test | |
| - dotnet-test | |
| - changepacks | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Linux manylinux | |
| - runner: ubuntu-22.04 | |
| target: x86_64 | |
| manylinux: auto | |
| os: linux | |
| - runner: ubuntu-22.04 | |
| target: x86 | |
| manylinux: auto | |
| os: linux | |
| - runner: ubuntu-22.04 | |
| target: aarch64 | |
| manylinux: auto | |
| os: linux | |
| - runner: ubuntu-22.04 | |
| target: armv7 | |
| manylinux: auto | |
| os: linux | |
| - runner: ubuntu-22.04 | |
| target: ppc64le | |
| manylinux: auto | |
| os: linux | |
| # Linux musllinux | |
| - runner: ubuntu-22.04 | |
| target: x86_64 | |
| manylinux: musllinux_1_2 | |
| os: musllinux | |
| - runner: ubuntu-22.04 | |
| target: x86 | |
| manylinux: musllinux_1_2 | |
| os: musllinux | |
| - runner: ubuntu-22.04 | |
| target: aarch64 | |
| manylinux: musllinux_1_2 | |
| os: musllinux | |
| - runner: ubuntu-22.04 | |
| target: armv7 | |
| manylinux: musllinux_1_2 | |
| os: musllinux | |
| # Windows | |
| - runner: windows-latest | |
| target: x64 | |
| os: windows | |
| python-target: x64 | |
| - runner: windows-latest | |
| target: x86 | |
| os: windows | |
| python-target: x86 | |
| # macOS | |
| - runner: macos-14 | |
| target: x86_64 | |
| os: macos | |
| - runner: macos-14 | |
| target: aarch64 | |
| os: macos | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.x | |
| architecture: ${{ matrix.python-target || '' }} | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@main | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --find-interpreter | |
| working-directory: packages/python | |
| manylinux: ${{ matrix.manylinux || '' }} | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }}-${{ matrix.target }} | |
| path: packages/python/dist | |
| node-publish: | |
| name: Node Publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| needs: | |
| - changepacks | |
| - node-build | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'packages/node/package.json') }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install maturin | |
| run: uv pip install maturin --system | |
| - name: Install | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build | |
| run: bun run build | |
| working-directory: packages/node | |
| # - name: create npm dirs | |
| # run: bunx napi create-npm-dirs | |
| # working-directory: packages/node | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: packages/node/pkg/* | |
| # - name: Move artifacts | |
| # run: bun run artifacts | |
| # working-directory: packages/node | |
| # - name: List packages | |
| # run: ls -R ./npm | |
| # working-directory: packages/node | |
| - name: Publish | |
| run: | | |
| # bun install -g @napi-rs/cli | |
| bun run build | |
| echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | |
| npm publish --access public | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| working-directory: packages/node | |
| # - name: Upload Asset | |
| # uses: owjs3901/upload-github-release-asset@main | |
| # with: | |
| # upload_url: ${{ fromJson(needs.changepacks.outputs.release_assets_urls)['packages/node/package.json'] }} | |
| # asset_path: packages/node/pkg/* | |
| python-publish: | |
| name: Python Publish | |
| runs-on: ubuntu-latest | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'packages/python/pyproject.toml') }} | |
| needs: | |
| - changepacks | |
| - python-build | |
| permissions: | |
| # Use to sign the release artifacts | |
| id-token: write | |
| # Used to upload release artifacts | |
| contents: write | |
| # Used to generate artifact attestation | |
| attestations: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| - name: Generate artifact attestation | |
| uses: actions/attest-build-provenance@v1 | |
| with: | |
| subject-path: 'wheels-*/*' | |
| - name: Publish to PyPI | |
| uses: PyO3/maturin-action@main | |
| env: | |
| MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
| with: | |
| command: upload | |
| args: --non-interactive --skip-existing wheels-*/* | |
| - name: List wheels | |
| run: ls -R . | |
| - name: Upload Asset | |
| uses: owjs3901/upload-github-release-asset@main | |
| with: | |
| upload_url: ${{ fromJson(needs.changepacks.outputs.release_assets_urls)['packages/python/pyproject.toml'] }} | |
| asset_path: '*/*.whl' | |
| upload-assets: | |
| needs: changepacks | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'libs/braillify/Cargo.toml') }} | |
| permissions: | |
| contents: write | |
| id-token: write | |
| name: Upload Assets for ${{ matrix.platform }} | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: ubuntu-22.04 | |
| os: linux | |
| target: x86_64-unknown-linux-gnu | |
| binary_name: braillify-linux-x86_64 | |
| - platform: windows-2022 | |
| os: windows | |
| target: x86_64-pc-windows-msvc | |
| binary_name: braillify-windows-x86_64.exe | |
| - platform: macos-14 | |
| os: macos | |
| target: x86_64-apple-darwin | |
| binary_name: braillify-darwin-x86_64 | |
| - platform: macos-14 | |
| os: macos | |
| target: aarch64-apple-darwin | |
| binary_name: braillify-darwin-arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: ${{ matrix.target }} | |
| components: clippy, rustfmt | |
| - name: Build Rust binary | |
| run: cargo build --release --target ${{ matrix.target }} -p braillify | |
| - name: Rename binary | |
| run: mv target/${{ matrix.target }}/release/braillify${{ matrix.os == 'windows' && '.exe' || '' }} ${{ matrix.binary_name }} | |
| - name: Upload Asset | |
| uses: owjs3901/upload-github-release-asset@main | |
| with: | |
| upload_url: ${{ fromJson(needs.changepacks.outputs.release_assets_urls)['libs/braillify/Cargo.toml'] }} | |
| asset_path: ${{ matrix.binary_name }} | |
| cargo-publish: | |
| name: Cargo Publish | |
| runs-on: ubuntu-latest | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'libs/braillify') }} | |
| needs: | |
| - changepacks | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Publish to Cargo | |
| run: cargo publish -p braillify | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| winget-publish: | |
| name: Winget Publish | |
| runs-on: windows-2022 | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'libs/braillify/Cargo.toml') }} | |
| needs: | |
| - changepacks | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: x86_64-pc-windows-msvc | |
| components: clippy, rustfmt | |
| - name: Build Rust binary | |
| run: cargo build --release --target x86_64-pc-windows-msvc -p braillify | |
| - name: Extract version | |
| run: | | |
| echo "version=$(cargo pkgid -p braillify | sed -E 's/.*#([0-9]+\.[0-9]+\.[0-9]+).*/\1/')" >> $GITHUB_OUTPUT | |
| id: version | |
| - uses: vedantmgoyal9/winget-releaser@main | |
| with: | |
| identifier: Braillify.Braillify | |
| installers-regex: '\.exe$' # Only .exe files | |
| token: ${{ secrets.WINGET_TOKEN }} | |
| version: ${{ steps.version.outputs.version }} | |
| # dotnet | |
| dotnet-build: | |
| name: .NET Build - ${{ matrix.rid }} | |
| runs-on: ${{ matrix.runner }} | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'packages/dotnet') }} | |
| needs: | |
| - test | |
| - changepacks | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Windows | |
| - runner: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| rid: win-x64 | |
| lib_name: braillify_native.dll | |
| - runner: windows-latest | |
| target: i686-pc-windows-msvc | |
| rid: win-x86 | |
| lib_name: braillify_native.dll | |
| - runner: windows-latest | |
| target: aarch64-pc-windows-msvc | |
| rid: win-arm64 | |
| lib_name: braillify_native.dll | |
| # Linux | |
| - runner: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| rid: linux-x64 | |
| lib_name: libbraillify_native.so | |
| - runner: ubuntu-22.04 | |
| target: aarch64-unknown-linux-gnu | |
| rid: linux-arm64 | |
| lib_name: libbraillify_native.so | |
| # macOS | |
| - runner: macos-14 | |
| target: x86_64-apple-darwin | |
| rid: osx-x64 | |
| lib_name: libbraillify_native.dylib | |
| - runner: macos-14 | |
| target: aarch64-apple-darwin | |
| rid: osx-arm64 | |
| lib_name: libbraillify_native.dylib | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: ${{ matrix.target }} | |
| - name: Install cross-compilation tools (Linux ARM64) | |
| if: matrix.rid == 'linux-arm64' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| - name: Build native library | |
| run: cargo build --release --target ${{ matrix.target }} -p dotnet | |
| env: | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dotnet-native-${{ matrix.rid }} | |
| path: target/${{ matrix.target }}/release/${{ matrix.lib_name }} | |
| if-no-files-found: error | |
| dotnet-publish: | |
| name: .NET Publish | |
| runs-on: ubuntu-latest | |
| if: ${{ contains(needs.changepacks.outputs.changepacks, 'packages/dotnet') }} | |
| needs: | |
| - changepacks | |
| - dotnet-build | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Download all native artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: native-artifacts | |
| pattern: dotnet-native-* | |
| - name: Prepare native libraries | |
| run: | | |
| # Create runtimes directories | |
| mkdir -p packages/dotnet/BraillifyNet/runtimes/win-x64/native | |
| mkdir -p packages/dotnet/BraillifyNet/runtimes/win-x86/native | |
| mkdir -p packages/dotnet/BraillifyNet/runtimes/win-arm64/native | |
| mkdir -p packages/dotnet/BraillifyNet/runtimes/linux-x64/native | |
| mkdir -p packages/dotnet/BraillifyNet/runtimes/linux-arm64/native | |
| mkdir -p packages/dotnet/BraillifyNet/runtimes/osx-x64/native | |
| mkdir -p packages/dotnet/BraillifyNet/runtimes/osx-arm64/native | |
| # Copy native libraries to runtimes folders | |
| cp native-artifacts/dotnet-native-win-x64/* packages/dotnet/BraillifyNet/runtimes/win-x64/native/ | |
| cp native-artifacts/dotnet-native-win-x86/* packages/dotnet/BraillifyNet/runtimes/win-x86/native/ | |
| cp native-artifacts/dotnet-native-win-arm64/* packages/dotnet/BraillifyNet/runtimes/win-arm64/native/ | |
| cp native-artifacts/dotnet-native-linux-x64/* packages/dotnet/BraillifyNet/runtimes/linux-x64/native/ | |
| cp native-artifacts/dotnet-native-linux-arm64/* packages/dotnet/BraillifyNet/runtimes/linux-arm64/native/ | |
| cp native-artifacts/dotnet-native-osx-x64/* packages/dotnet/BraillifyNet/runtimes/osx-x64/native/ | |
| cp native-artifacts/dotnet-native-osx-arm64/* packages/dotnet/BraillifyNet/runtimes/osx-arm64/native/ | |
| # List for verification | |
| echo "=== Native libraries ===" | |
| find packages/dotnet/BraillifyNet/runtimes -type f | |
| - name: Build and Pack BraillifyNet | |
| run: dotnet pack -c Release -o nupkg | |
| working-directory: packages/dotnet/BraillifyNet | |
| - name: Build and Pack Braillify CLI | |
| run: dotnet pack -c Release -o nupkg | |
| working-directory: packages/dotnet/Braillify | |
| - name: List packages | |
| run: | | |
| echo "=== NuGet packages ===" | |
| find packages/dotnet -name "*.nupkg" -type f | |
| - name: Publish to NuGet | |
| run: | | |
| dotnet nuget push packages/dotnet/BraillifyNet/nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| dotnet nuget push packages/dotnet/Braillify/nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Upload NuGet packages as artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: packages/dotnet/**/nupkg/*.nupkg |