Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/swan-ci-ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
push:
tags:
- '*/v*'

jobs:
build-publish:

runs-on: ubuntu-latest
environment: publish
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not strictly required, but PyPI recommends setting the environment:

Image

permissions:
id-token: write
Comment on lines +17 to +18
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This permission is required for the publish action: https://github.com/pypa/gh-action-pypi-publish


steps:
- uses: actions/checkout@v2
Expand All @@ -33,20 +36,17 @@ jobs:
- name: Install dependencies
run: |
cd $PACKAGE_NAME
pip install twine uv
pip install uv

- name: Build wheel
run: |
cd $PACKAGE_NAME
uv build

- name: Publish distribution to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
cd $PACKAGE_NAME
twine upload --repository pypi dist/*
- name: Publish distribution to PyPI 🚀
uses: pypa/gh-action-pypi-publish@release/v1
with:
package-dir: ./${{ env.PACKAGE_NAME }}/dist/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default package-dir is dist/ so we need to change it to point to the correct package


- name: Create Release
id: create_release
Expand Down