Skip to content

Commit

Permalink
add comments to release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
purva-thakre committed Dec 28, 2023
1 parent edde082 commit 4c0fee9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ on: push
jobs:
build:
name: Build distribution
# define the job for building the dist packages + store for later use
runs-on: ubuntu-latest

# download the repo in the CI runner + install/activate the newest release for chosen python version
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: "3.10"
- name: Install pypa/build
# build the dists from source and store them + use `build` package
run: >-
python3 -m
pip install
Expand All @@ -30,16 +32,19 @@ jobs:
name: python-package-distributions
path: dist/

# initial setup for job to publish
# PyPI publishing workflow is only triggered if the current commit is tagged
publish-to-pypi:
name: >-
Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
# might want to make changes to this as needed
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
url: https://pypi.org/p/toqito # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

Expand All @@ -49,6 +54,8 @@ jobs:
# https://github.com/marketplace/actions/release-changelog-builder

- name: Download all the dists
# Publishing the distribution to PyPI
# stored distribution is downloaded by the download-artifact action then uploaded to PyPi via dist/
uses: actions/download-artifact@v3
with:
name: python-package-distributions
Expand Down Expand Up @@ -99,6 +106,7 @@ jobs:
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
# test above in testpypi
publish-to-testpypi:
name: Publish Python distribution to TestPyPI
needs:
Expand Down

0 comments on commit 4c0fee9

Please sign in to comment.