0.0.21 #20
Workflow file for this run
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: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- main | |
paths: | |
- "python/pyproject.toml" | |
workflow_dispatch: | |
env: | |
POETRY_VERSION: "1.4.2" | |
jobs: | |
if_release: | |
if: | | |
${{ github.event.pull_request.merged == true }} | |
&& ${{ contains(github.event.pull_request.labels.*.name, 'release') }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
# Python Build | |
- name: Install poetry | |
run: pipx install poetry==$POETRY_VERSION | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "poetry" | |
- name: Build project for distribution | |
run: cd python && poetry build | |
# JS Build | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "yarn" | |
cache-dependency-path: "js/yarn.lock" | |
- name: Install dependencies | |
run: cd js && yarn install --immutable | |
- name: Build | |
run: cd js && yarn run build | |
- name: Check Version | |
id: check-version | |
run: | | |
cd python && echo version=$(poetry version --short) >> $GITHUB_OUTPUT | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: | | |
- "python/dist/*" | |
- "js/dist/*" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: false | |
generateReleaseNotes: true | |
tag: v${{ steps.check-version.outputs.version }} | |
commit: main | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: "python/dist" |