-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: BAML Runtime | ||
name: BAML Release | ||
|
||
on: | ||
push: | ||
|
@@ -28,20 +28,20 @@ jobs: | |
with: | ||
workspaces: engine | ||
- name: Bindgen | ||
run: cargo update -p wasm-bindgen | ||
run: cargo install -f wasm-bindgen[email protected] | ||
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 | ||
uses: actions/setup-node@v3 | ||
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 |