Skip to content

Commit

Permalink
working vscode (#622)
Browse files Browse the repository at this point in the history
Add BAML rust runtime

---------

Co-authored-by: Sam Lijin <[email protected]>
Co-authored-by: Vaibhav Gupta <[email protected]>
Co-authored-by: Anish-Palakurthi <[email protected]>
Co-authored-by: Anish Palakurthi <[email protected]>
  • Loading branch information
5 people authored May 31, 2024
1 parent 553bec8 commit 305ca1a
Show file tree
Hide file tree
Showing 1,333 changed files with 52,935 additions and 69,000 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/release_language_client_python.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
name: Release language_client_python

on:
push:
branches: ["canary"]
workflow_dispatch: {}

permissions:
contents: read
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
matrix:
_:
- runs_on: ubuntu-latest
Expand Down Expand Up @@ -48,6 +55,13 @@ jobs:
args: --release --out engine/language_client_python/dist --manifest-path engine/language_client_python/Cargo.toml
sccache: "true"
manylinux: ${{ matrix._.runs_on == 'ubuntu-latest' && 'auto' || null }}
before-script-linux: |
if command -v yum &> /dev/null; then
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
else
# If we're running on debian-based system.
apt update -y && apt-get install -y libssl-dev openssl pkg-config
fi
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -58,14 +72,13 @@ jobs:
publish:
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/release/')
environment: release

#if: startsWith(github.ref, 'refs/tags/release/')
#environment: release
steps:
- uses: actions/download-artifact@v4
- run: mkdir dist && mv wheels-*/* dist

# authz is managed via OIDC configured at https://pypi.org/manage/project/baml-py/settings/publishing/
# it is pinned to this filename, so renaming this file is not safe!!: release_python_ffi.yaml
# it is pinned to this github actions filename, so renaming this file is not safe!!
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
138 changes: 138 additions & 0 deletions .github/workflows/release_language_client_ruby.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Release engine/language_client_ruby

on:
workflow_dispatch: {}
#push:
# branches:
# - sam/rust-llm

permissions:
contents: read
id-token: write

jobs:
build:
strategy:
fail-fast: false
matrix:
platform:
- x86_64-linux
- aarch64-linux
- x86_64-darwin
- arm64-darwin
#- x64-mingw-ucrt

runs-on: ubuntu-latest
steps:
- uses: rubygems/configure-rubygems-credentials@main
with:
# https://rubygems.org/profile/oidc/api_key_roles/rg_oidc_akr_p6x4xz53qtk948na3bgy
role-to-assume: rg_oidc_akr_p6x4xz53qtk948na3bgy

- uses: actions/checkout@v4

- run: cd engine/language_client_ruby

- uses: oxidize-rb/actions/setup-ruby-and-rust@main
with:
rubygems: latest
ruby-version: "3.3"
bundler-cache: false
cargo-cache: false
cargo-vendor: false

#################################################################################################################
#
# BEGIN: these steps are copied from https://github.com/oxidize-rb/actions/blob/main/cross-gem/action.yml
#
# We can't use oxidize-rb/actions/cross-gem@main directly, unfortunately, because our Ruby FFI lib is a member
# of the top-level workspace, and we need to do stuff to make rb-sys-dock play nice with it
#
#################################################################################################################

- name: Configure environment
shell: bash
id: configure
run: |
: Configure environment
echo "RB_SYS_DOCK_UID=$(id -u)" >> $GITHUB_ENV
echo "RB_SYS_DOCK_GID=$(id -g)" >> $GITHUB_ENV
rb_sys_version="$((grep rb_sys Gemfile.lock | head -n 1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') || (gem info rb_sys --remote | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') || echo "latest")"
rb_sys_dock_cache_dir="$HOME/.cache/rb-sys-$rb_sys_version"
mkdir -p "$rb_sys_dock_cache_dir"
echo "RB_SYS_DOCK_CACHE_DIR=$rb_sys_dock_cache_dir" >> $GITHUB_ENV
echo "rb_sys_version=$rb_sys_version" >> $GITHUB_OUTPUT
#- name: Setup caching
# uses: actions/cache@v4
# with:
# path: |
# ${{ env.RB_SYS_DOCK_CACHE_DIR }}
# tmp/rb-sys-dock/${{ inputs.platform }}/target
# key: rb-sys-dock-${{ inputs.cache-version }}-${{ inputs.platform }}-${{ hashFiles('**/Gemfile.lock', '**/Cargo.lock') }}
# save-always: ${{ inputs.cache-save-always == 'true' }}
# restore-keys: |
# rb-sys-dock-${{ inputs.cache-version }}-${{ inputs.platform }}-

#- name: Install cargo-cache
# uses: oxidize-rb/actions/cargo-binstall@v1
# id: install-cargo-cache
# if: inputs.cargo-cache-clean == 'true'
# with:
# crate: cargo-cache
# version: 0.8.3
# strategies: quick-install

#- name: Clean the cargo cache
# if: inputs.cargo-cache-clean == 'true'
# uses: oxidize-rb/actions/post-run@v1
# with:
# run: cargo-cache --autoclean
# cwd: ${{ inputs.working-directory }}
# always: ${{ inputs.cache-save-always == 'true' }}

- name: Setup rb-sys
shell: bash
run: |
version="${{ steps.configure.outputs.rb_sys_version }}"
echo "Installing rb_sys@$version"
if [ "$version" = "latest" ]; then
gem install rb_sys
else
gem install rb_sys -v $version
fi
- run: |
echo "Switching to top-level workspace - we need to be able to resolve the root-level Cargo.toml"
cd ..
pwd
- name: Build gem
shell: bash
run: |
: Compile gem
echo "Docker Working Directory: $(pwd)"
set -x
rb-sys-dock \
--platform ${{ matrix.platform }} \
--mount-toolchains \
--directory language_client_ruby \
--ruby-versions 3.3,3.2,3.1,3.0,2.7 \
--build \
-- sudo yum install -y perl-IPC-Cmd
#################################################################################################################
#
# END: these steps are copied from https://github.com/oxidize-rb/actions/blob/main/cross-gem/action.yml
#
# We can't use oxidize-rb/actions/cross-gem@main directly, unfortunately, because our Ruby FFI lib is a member
# of the top-level workspace, and we need to do stuff to make rb-sys-dock play nice with it
#
#################################################################################################################

- run: |
for i in $(ls pkg/*.gem); do
gem push $i
done
Loading

0 comments on commit 305ca1a

Please sign in to comment.