release #207
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
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
release_type: | |
description: 'Release type' | |
required: true | |
type: choice | |
default: 'patch' | |
options: | |
- major | |
- minor | |
- patch | |
- alpha | |
defaults: | |
run: | |
shell: bash --noprofile --norc -exo pipefail {0} | |
env: | |
LINES: 120 | |
COLUMNS: 120 | |
OPENLLM_DO_NOT_TRACK: True | |
PYTHONUNBUFFERED: '1' | |
HATCH_VERBOSE: 2 | |
jobs: | |
release: | |
if: github.repository_owner == 'bentoml' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # ratchet:actions/checkout@v4.1.6 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.OPENLLM_PAT }} | |
- uses: bentoml/setup-bentoml-action@862aa8fa0e0c3793fcca4bfe7a62717a497417e4 # ratchet:bentoml/setup-bentoml-action@v1 | |
with: | |
bentoml-version: 'main' | |
python-version-file: .python-version-default | |
- name: Import bot's GPG key for signing commits | |
id: import-gpg | |
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # ratchet:crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_config_global: true | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_tag_gpgsign: true | |
- name: Install jq and curl | |
run: sudo apt-get install -y jq curl | |
- name: Create a release | |
env: | |
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }} | |
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }} | |
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }} | |
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: |- | |
pip install ghapi inflection tomlkit orjson | |
./.github/actions/release.sh --release ${{ inputs.release_type }} | |
- name: Set project version | |
id: version | |
run: |- | |
version="$(git describe --tags "$(git rev-list --tags --max-count=1)")" | |
echo "Release version: $version" | |
echo "version=$version" >> $GITHUB_OUTPUT | |
build-pypi: | |
if: github.repository_owner == 'bentoml' | |
needs: | |
- release | |
name: Compile PyPI distribution for OpenLLM | |
uses: bentoml/OpenLLM/.github/workflows/build-pypi.yml@main # ratchet:exclude | |
with: | |
tags: ${{ needs.release.outputs.version }} | |
publish-python: | |
needs: | |
- build-pypi | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # ratchet:actions/checkout@v4.1.6 | |
with: | |
ref: '${{ needs.release.outputs.version }}' | |
token: ${{ secrets.OPENLLM_PAT }} | |
# NOTE: Keep this section in sync with build-pypi.yml | |
- name: Download Python artifacts | |
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # ratchet:actions/download-artifact@v4 | |
with: | |
pattern: python-artefacts-* | |
merge-multiple: true | |
path: dist | |
- name: Smoke test compiled artefacts | |
run: ls -R dist | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # ratchet:pypa/gh-action-pypi-publish@release/v1 | |
with: | |
print-hash: true | |
binary-distribution: | |
if: github.repository_owner == 'bentoml' | |
needs: publish-python | |
name: Create binary/wheels distribution | |
uses: bentoml/OpenLLM/.github/workflows/binary-releases.yml@main # ratchet:exclude | |
release-notes: | |
if: github.repository_owner == 'bentoml' | |
needs: | |
- release | |
- publish-python | |
- binary-distribution | |
name: Create release notes and setup for next cycle | |
uses: bentoml/OpenLLM/.github/workflows/release-notes.yml@main # ratchet:exclude | |
with: | |
tags: ${{ needs.release.outputs.version }} |