Skip to content

Commit

Permalink
update CI/CD to build dist packages (#5)
Browse files Browse the repository at this point in the history
* include build dev requirement

* add build step to github action

* wip

* wip

* cicd to publish to pypi
  • Loading branch information
xbrianh authored Sep 3, 2024
1 parent b55ebe8 commit 5736821
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
43 changes: 35 additions & 8 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,45 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: tox
pypi-publish:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
name: Upload release to PyPI
build:
runs-on: ubuntu-latest
name: Build dist packages
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
pip install -r requirements-dev.txt
- name: Build
run: |
make build
- name: Store distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
runs-on: ubuntu-latest
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs: build
environment:
name: pypi
url: https://pypi.org/p/xdlake
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Build
run: |
make build
- name: Publish package distributions to PyPI
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
pandas
deltalake
ruff-lsp
Expand Down

0 comments on commit 5736821

Please sign in to comment.