Skip to content

Commit

Permalink
Create release_language_client_python.yaml (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxlijin authored May 3, 2024
1 parent b15ccba commit 553bec8
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/release_language_client_python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release language_client_python

on:
workflow_dispatch: {}

permissions:
contents: read
id-token: write

jobs:
build:
strategy:
matrix:
_:
- runs_on: ubuntu-latest
target: x86_64
name: x86_64-unknown-linux-gnu

- runs_on: ubuntu-latest
target: aarch64
name: aarch64-unknown-linux-gnu

- runs_on: macos-latest
target: x86_64
name: x86_64-apple-darwin

- runs_on: macos-latest
target: aarch64
name: aarch64-apple-darwin

- runs_on: windows-latest
target: x64
name: x86_64-pc-windows-msvc

runs-on: ${{ matrix._.runs_on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
architecture: ${{ matrix._.runs_on == 'windows-latest' && 'x64' || null }}

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix._.target }}
command: build
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 }}

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix._.name }}
path: engine/language_client_python/dist

publish:
runs-on: ubuntu-latest
needs: [build]
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
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 553bec8

Please sign in to comment.