diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0924c3b05..1db01a2e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: BAML Runtime +name: BAML Release on: push: @@ -28,12 +28,11 @@ jobs: with: workspaces: engine - name: Bindgen - run: cargo update -p wasm-bindgen + run: cargo install -f wasm-bindgen-cli@0.2.92 working-directory: engine/baml-schema-wasm - uses: pnpm/action-setup@v3 with: version: 8 - package_json_file: typescript/package.json run_install: false # Set up Node.js - name: Setup Node.js @@ -41,7 +40,8 @@ jobs: with: cache: "pnpm" node-version: 18 - cache-dependency-path: typescript/**/pnpm-lock.yaml + cache-dependency-path: | + typescript/**/pnpm-lock.yaml - name: Install Dependencies run: pnpm install --frozen-lockfile working-directory: typescript/ @@ -197,7 +197,6 @@ jobs: publish-to-pypi: environment: release needs: [build-release, build-wasm] - if: ${{ !startsWith(github.ref, 'refs/tags/test-release') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -211,22 +210,58 @@ jobs: # authz is managed via OIDC configured at https://pypi.org/manage/project/baml-py/settings/publishing/ # it is pinned to this github actions filename, so renaming this file is not safe!! - name: Publish package to PyPI + if: ${{ !startsWith(github.ref, 'refs/tags/test-release') }} uses: pypa/gh-action-pypi-publish@release/v1 publish-to-npm: environment: release needs: [build-release, build-wasm] - if: ${{ !startsWith(github.ref, 'refs/tags/test-release') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 + + - name: setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 9.0.6 + package_json_file: engine/language_client_typescript/package.json + run_install: false + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + cache-dependency-path: engine/language_client_typescript/pnpm-lock.yaml + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: pnpm install + working-directory: engine/language_client_typescript + - uses: actions/download-artifact@v4 with: name: bindings-* - + + - name: create npm dirs + run: pnpm napi create-npm-dirs + working-directory: engine/language_client_typescript + + - name: Move artifacts + run: pnpm artifacts + working-directory: engine/language_client_typescript + + - name: Publish + if: ${{ !startsWith(github.ref, 'refs/tags/test-release') }} + run: | + npm publish --access public + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + publish-vscode: environment: release needs: [build-release, build-wasm] @@ -269,6 +304,7 @@ jobs: run: pnpm install --frozen-lockfile working-directory: typescript/ - name: Publish + if: ${{ !startsWith(github.ref, 'refs/tags/test-release') }} run: | pnpm run vscode:publish --pre-release --no-git-tag-version -p ${{ secrets.VSCODE_PAT }} working-directory: typescript/vscode-ext/packages \ No newline at end of file