Add release and publish jobs #1
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
# This will run every time a tag is created. | ||
# It calls our tests workflow via a `workflow_call`, and if tests pass | ||
# then it triggers our upload to PyPI for a new release. | ||
name: Publish to PyPI | ||
on: | ||
push: | ||
tags: | ||
permissions: | ||
contents: read | ||
jobs: | ||
# calls our general CI workflow (tests, build docs, etc.) | ||
tests: | ||
uses: ./.github/workflows/CI.yaml | ||
Check failure on line 16 in .github/workflows/publish.yaml GitHub Actions / .github/workflows/publish.yamlInvalid workflow file
|
||
build-package: | ||
name: "Build & verify π» Lours package" | ||
needs: [tests] # require tests to pass before deploy runs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout repository π" | ||
uses: actions/checkout@v4 | ||
- name: Install poetry | ||
uses: abatilo/actions-poetry@v3 | ||
- name: "Build and inspect package π¦" | ||
uses: hynek/build-and-inspect-python-package@v2 | ||
id: baipp | ||
release-pypi: | ||
runs-on: ubuntu-latest | ||
needs: [build-package] | ||
permissions: | ||
id-token: write # needed for PyPI upload | ||
steps: | ||
- name: "Download π» Lours built package π¦" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
- name: "Unzip artifact" | ||
run: | | ||
tar xvf dist/*.tar.gz --strip-components=1 | ||
- name: "Publish π» Lours package to PyPI π" | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: github.repository_owner == 'XXII-AI' |