Skip to content

Commit

Permalink
chore: Add workflow to publish autopilot-utils to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
mkah91 committed Oct 24, 2024
1 parent 2d56a4e commit add756b
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/publish-autopilot-utils.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish Autopilot Utils to PyPI

on:
workflow_dispatch:
push:
branches:
- add-autopilot-utils-publish-workflow

env:
PYTHON_APPS_FOLDER: yaku-apps-python

jobs:
build-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: ${{ env.PYTHON_APPS_FOLDER }}

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Setup pants
uses: pantsbuild/actions/init-pants@v8
with:
gha-cache-key: cache0
named-caches-hash: ${{ hashFiles(env.PANTS_LOCK_FILES) }}
env:
PANTS_LOCK_FILES: ${{ env.PYTHON_APPS_FOLDER }}/3rdparty/*.txt

- name: Build wheel
run: |
pants package ${{ env.PYTHON_APPS_FOLDER }}/packages/autopilot-utils/::
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: autopilot-utils-package-distributions
path: dist/*.whl


publish-to-pypi:
runs-on: ubuntu-latest
needs: [build-package]
env:
name: pypi
url: https://pypi.org/p/autopilot-utils
permissions:
id-token: write
steps:
- name: Download distribution packages
uses: actions/download-artifact@v4
with:
name: autopilot-utils-package-distributions
path: dist/

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

0 comments on commit add756b

Please sign in to comment.