Skip to content

Commit

Permalink
Merge pull request #25 from PDBeurope/fix-gh-workflow
Browse files Browse the repository at this point in the history
Updated GH workflow
  • Loading branch information
sreenathnair committed Jan 24, 2024
2 parents f495a5b + 9558608 commit 258855b
Showing 1 changed file with 38 additions and 27 deletions.
65 changes: 38 additions & 27 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,46 @@ permissions:

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Archive the package
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
deploy:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python distribution to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/pdbe-arpeggio
permissions:
id-token: write
needs: build
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
- 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

0 comments on commit 258855b

Please sign in to comment.