Skip to content

Commit

Permalink
chore(gha): use OICD for pypi releases
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop authored Apr 19, 2024
1 parent 17c5c11 commit f86ccce
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- published

jobs:
release:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.parse.outputs.version }}
Expand All @@ -31,22 +31,40 @@ jobs:
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Install deps
run: python -m pip install --upgrade pip setuptools_scm build twine
run: python -m pip install --upgrade pip setuptools_scm build

- name: Build
working_directory: projects/${{ steps.parse.outputs.name }}
working-directory: projects/${{ steps.parse.outputs.name }}
run: python -m build

- name: Publish PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
working-directory: projects/${{ steps.parse.outputs.name }}
run: twine upload dist/*
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: dist
path: dist

pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/${{ needs.build.outputs.name }}
permissions:
id-token: write
steps:
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

release-container:
if: ${{ needs.release.outputs.name == "fal" }}
if: ${{ needs.build.outputs.name == "fal" }}
uses: ./.github/workflows/container.yml
needs: release
needs: build
with:
version: ${{ needs.release.outputs.version }}
version: ${{ needs.build.outputs.version }}

0 comments on commit f86ccce

Please sign in to comment.