Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
parashardhapola committed Jul 26, 2024
1 parent a740f53 commit baac270
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,47 @@
name: Upload Scarf
name: Publish Scarf build to PyPI

on:
release:
types: [published]

jobs:
deploy:

build:
name: Build distribution
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install build
- name: Build package
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel build
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish to PyPI
needs:
- build
runs-on: ubuntu-22.04
environment:
name: pypi
url: https://pypi.org/p/scarf
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- 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 baac270

Please sign in to comment.