Skip to content

release

release #6

Workflow file for this run

# Adapted from https://github.com/langchain-ai/langchain/blob/221134d2395b56bfd4cb8f52edc516989e647bc7/.github/workflows/_release.yml
name: release
on:
push:
tags:
- "v*"
env:
POETRY_VERSION: "1.6.1"
jobs:
release:
# Only release on tags
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
# This permission is used for trusted publishing:
# https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
#
# Trusted publishing has to also be configured on PyPI for each package:
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/
id-token: write
# This permission is needed by `ncipollo/release-action` to create the GitHub release.
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Poetry ${{ env.POETRY_VERSION }}
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- name: Build project for distribution
run: poetry build
- name: Check Version
id: check-version
run: |
echo version=$(poetry version --short) >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
tag: v${{ steps.check-version.outputs.version }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
verbose: true
print-hash: true