update #3
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 Types to npm | |
| on: | |
| push: | |
| branches: | |
| - npm | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (e.g. 0.14.0)' | |
| required: true | |
| jobs: | |
| publish-types: | |
| runs-on: ubuntu-22.04-arm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake clang curl gcc llvm make pkg-config libelf-dev libclang-dev zlib1g-dev | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Generate OpenAPI spec | |
| run: cargo test -p landscape-webserver export_openapi_json -- --nocapture | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies & generate types | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm --filter @landscape-router/types generate | |
| - name: Set version | |
| run: | | |
| if [ -n "${{ github.event.inputs.version }}" ]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| else | |
| VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "landscape-webserver") | .version') | |
| fi | |
| cd landscape-types | |
| pnpm pkg set version="$VERSION" | |
| - name: Publish to npm | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
| pnpm --filter @landscape-router/types publish --no-git-checks --access public |