Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
javinoram authored Feb 23, 2024
1 parent e47063d commit ec5d53e
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Publish Python 🐍 distributions 📦 to PyPI

on:
push:
tags:
- '*'

permissions:
contents: read

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI

deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3

- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pypa/setuptools
run: >-
python -m
pip install wheel
- name: Extract tag name
id: tag
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.cfg
run: sed -i "s/version =.*/version = ${{ steps.tag.outputs.TAG_NAME }}/g" setup.cfg
- name: Build a binary wheel
run: >-
python setup.cfg sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
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: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit ec5d53e

Please sign in to comment.