Skip to content

Commit

Permalink
publish to pypi only once
Browse files Browse the repository at this point in the history
  • Loading branch information
Man Parvesh Singh Randhawa committed Oct 4, 2024
1 parent b960992 commit 5acf430
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
- v2

jobs:
build:
test:
name: Test on all python versions
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -37,17 +38,37 @@ jobs:
- name: Run Tests
run: poetry run pytest

# Publish to PyPI
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/v2' && github.event_name == 'push'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry to use the local cache
run: poetry config virtualenvs.in-project false

- name: Install dependencies
run: poetry install --no-interaction --no-ansi

- name: Configure pypi api token
if: github.ref == 'refs/heads/v2' && github.event_name == 'push'
run: poetry config pypi-token.pypi $PYPI_API_TOKEN
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

- name: Build the package
if: github.ref == 'refs/heads/v2' && github.event_name == 'push'
run: poetry build

- name: Publish to PyPI
if: github.ref == 'refs/heads/v2' && github.event_name == 'push'
run: poetry publish
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[tool.poetry]
name = "yodapa"
version = "0.1.1"
version = "0.1.2"
description = "Personal Assistant on the command line"
authors = ["Man Parvesh Singh Randhawa <manparveshsinghrandhawa@gmail.com>"]
license = "MIT"
readme = "README.md"
packages = [
{ include = "yodapa", from = "src" }
]
repository = "https://github.com/yoda-pa/yoda/tree/v2"
homepage = "https://yoda-pa.github.io/"

[tool.poetry.dependencies]
python = "^3.9"
Expand Down

0 comments on commit 5acf430

Please sign in to comment.