Skip to content

Commit

Permalink
chore: Update package.yml workflow configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
joancipria committed Sep 6, 2024
1 parent 5ec2025 commit 7cfbab8
Showing 1 changed file with 40 additions and 33 deletions.
73 changes: 40 additions & 33 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,60 @@ name: Python Package Build and Publish
on:
push:
tags:
- "v*"
- 'v*'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel
- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel
- name: Build the package
run: |
python setup.py sdist bdist_wheel
- name: Build the package
run: |
python setup.py sdist bdist_wheel
- name: Check dist folder
run: ls -l dist
- name: Check dist folder
run: ls -l dist

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/

publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
python -m pip install --upgrade twine
twine upload dist/*
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: ./dist # Ensure the dist directory is created locally

- name: Check working directory
run: pwd

- name: Check dist folder
run: ls -l dist

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
python -m pip install --upgrade twine
twine upload ./dist/*

0 comments on commit 7cfbab8

Please sign in to comment.