Skip to content

Commit

Permalink
Merge pull request #64 from calgray/pypi-publishing
Browse files Browse the repository at this point in the history
Add pypi publishing Action
  • Loading branch information
calgray committed Jan 7, 2025
2 parents 2ece815 + 8599f05 commit 28c47b1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 23 deletions.
63 changes: 41 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,46 @@
on: [release]

jobs:
test:
uses: ./.github/workflows/ci.yml

publish:
pypi-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
needs: test
# The following steps to build a Docker image and publish to the GitHub container registry on release. Alternatively, can replace with other publising steps (ie. publishing to PyPI, deploying documentation etc.)
environment:
name: pypi
url: https://pypi.org/p/athreading
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.2.2
- name: Poetry Build
run: poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]

# gitlab-oci-publish:
# runs-on: ubuntu-latest
# needs: test
# # The following steps to build a Docker image and publish to the GitHub container registry on release. Alternatively, can replace with other publising steps (ie. publishing to PyPI, deploying documentation etc.)
# steps:
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Get image metadata
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ghcr.io/${{ github.repository }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v6
# with:
# push: true
# tags: ${{ steps.meta.outputs.tags }}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Added support for providing explicit background executor to decorators.
* Added call and iterate benchmarks.

### Changed<!--0.2.0->
### Changed<!--0.2.0-->

* Changed `call`, `iterate` and `generate` to higher-order-function decorators.

Expand Down

0 comments on commit 28c47b1

Please sign in to comment.