Skip to content

Commit

Permalink
Attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hellovai committed Jun 12, 2024
1 parent a826dde commit 7962e6b
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: BAML Runtime
name: BAML Release

on:
push:
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -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

0 comments on commit 7962e6b

Please sign in to comment.