Skip to content

Commit

Permalink
Fixed the bug with publishing package job (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeelDobariya38 authored Nov 11, 2023
2 parents 52ccd74 + 848e81b commit 416b922
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Run-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

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

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -47,10 +47,10 @@ jobs:

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

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
38 changes: 29 additions & 9 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ name: Publish Package

on:
release:
types: [created, prereleased]
types: [published]

jobs:
Release-nature:
runs-on: ubuntu-latest

steps:
- name: Check release type
run: |
if [ "${{ github.event_name }}" == "release" ]; then
echo "This is a stable release."
elif [ "${{ github.event_name }}" == "prerelease" ]; then
echo "This is a prerelease."
fi
Lint:
runs-on: ubuntu-latest

Expand All @@ -15,10 +27,10 @@ jobs:

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

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -45,10 +57,10 @@ jobs:

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

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -70,22 +82,30 @@ jobs:

steps:
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.12

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --no-root
- name: Update Poetry
run: |
pip install --upgrade poetry
- name: Debugging Output
run: |
cat pyproject.toml
- name: Build distribution and publish to PyPI
env:
POETRY_PYPI_USERNAME: ${{ secrets.POETRY_PYPI_USERNAME }}
POETRY_PYPI_TOKEN: ${{ secrets.POETRY_PYPI_TOKEN }}
run: |
poetry build
poetry publish --build
poetry publish --build --username $POETRY_PYPI_USERNAME --password $POETRY_PYPI_TOKEN

0 comments on commit 416b922

Please sign in to comment.