-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from calgray/pypi-publishing
Add pypi publishing Action
- Loading branch information
Showing
2 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters