Skip to content

Commit

Permalink
feat(main): pypi release (#26)
Browse files Browse the repository at this point in the history
* chore(github): add test pypi github secret

* chore(ci): add deploy step

* refactor(main): expose version information

* chore(todo): add to test pypi declartion

* docs(readme): renable readme in project

* refactor(ssm): updated pypi token

* refactor(ci): redirect to main pypi
  • Loading branch information
kiran94 authored May 22, 2023
1 parent 11100b8 commit 4eba9b5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ jobs:
if: github.ref == 'refs/heads/main' && steps.release.outputs.version != ''
run: poetry version ${{ steps.release.outputs.version }}

- name: Deploy
if: github.ref == 'refs/heads/main' && steps.release.outputs.version != ''
run: |
poetry build
poetry publish -u __token__ -p $POETRY_PYPI_TOKEN_PYPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}

- uses: EndBug/add-and-commit@v9
if: github.ref == 'refs/heads/main' && steps.release.outputs.version != ''
with:
Expand Down
3 changes: 3 additions & 0 deletions prfiesta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import importlib.metadata
import logging
import os

from rich.logging import RichHandler

__version__ = importlib.metadata.version(__name__)

LOGGING_LEVEL=os.environ.get('LOGGING_LEVEL', logging.INFO)
LOGGING_FORMAT=os.environ.get('LOGGING_FORMAT', '%(message)s')
SPINNER_STYLE=os.environ.get('SPINNER_STYLE', 'blue')
Expand Down
3 changes: 2 additions & 1 deletion prfiesta/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from rich.spinner import Spinner
from rich.text import Text

from prfiesta import SPINNER_STYLE
from prfiesta import SPINNER_STYLE, __version__
from prfiesta.collectors.github import GitHubCollector
from prfiesta.environment import GitHubEnvironment
from prfiesta.output import output_frame
Expand All @@ -25,6 +25,7 @@
@click.option('-dc', '--drop_columns', multiple=True, help='Drop columns from the output dataframe')
@click.option('--after', type=click.DateTime(formats=['%Y-%m-%d']), help='Only search for pull requests after this date e.g 2023-01-01')
@click.option('--before', type=click.DateTime(formats=['%Y-%m-%d']), help='Only search for pull requests before this date e.g 2023-04-30')
@click.version_option(__version__)
def main(**kwargs) -> None:

users: tuple[str] = kwargs.get('users')
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.6.0"
description = "Analyze Individual Contributor Pull Requests"
authors = ["kiran94"]
license = "MIT"
# readme = "README.md"
readme = "README.md"
homepage = "https://github.com/kiran94/prfiesta"
repository = "https://github.com/kiran94/prfiesta"
documentation = "https://github.com/kiran94/prfiesta/README.md"
Expand Down
8 changes: 8 additions & 0 deletions terraform/github.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ resource "github_repository" "main" {
]
}

# SECRETS

resource "github_actions_secret" "pypi_token" {
repository = github_repository.main.name
secret_name = "POETRY_PYPI_TOKEN_PYPI"
plaintext_value = data.aws_ssm_parameter.pypi_token.value
}

# OUTPUTS

output "github_repository_ssh_clone_url" {
Expand Down
3 changes: 3 additions & 0 deletions terraform/ssm.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_ssm_parameter" "pypi_token" {
name = "/pypi/token"
}

0 comments on commit 4eba9b5

Please sign in to comment.