Update README.md #13
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 to JSR (@serial/cpp-bindings-linux) | |
| on: | |
| workflow_dispatch: | |
| inputs: {} | |
| push: | |
| branches: | |
| - '*' | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish-jsr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install build dependencies | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends ninja-build g++ git ca-certificates | |
| - name: Setup CMake >= 3.30 | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: "3.31.x" | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: "2.x" | |
| - name: Configure CMake (Release) | |
| env: | |
| CXX: g++ | |
| run: | | |
| cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release | |
| - name: Build shared library | |
| run: | | |
| cmake --build build --config Release | |
| - name: Embed binary as JSON/base64 for JSR | |
| run: | | |
| ./jsr/scripts/embed_binary.sh \ | |
| build/libcpp_bindings_linux.so \ | |
| linux-x86_64 | |
| cp LICENSE ./jsr/package/LICENSE | |
| - name: Publish package to JSR (real) | |
| if: github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/') | |
| working-directory: jsr/package | |
| run: | | |
| deno publish --allow-dirty | |
| - name: Publish package to JSR (dry-run) | |
| if: github.ref_name != 'main' && !startsWith(github.ref, 'refs/tags/') | |
| working-directory: jsr/package | |
| run: | | |
| deno publish --allow-dirty --dry-run |