Skip to main content

Python Interface for generating release notes for Github Actions

Project description

GPT Release Notes

Requirements

  • .env file -> .env
  • python packages requirements.txt
  • OPTIONAL - requirements-test.txt
  • Github Repository
  • OPENAI account

pip installation

pip install gg-release-notes

Installation

python3 -m pip install -r requirements.txt

Dev installation

python3 -m pip install -r dev.requirements.txt

Usage

Example python script

from release_notes.config.env_config import EnvConfig
from release_notes.config.github_config import GithubAPIConfig
from release_notes.config.prompt_config import PromptConfig

from release_notes.pull_request import ProdReleasePR
from release_notes.version import ReleaseVersion
from release_notes.generate_release_notes import ReleaseNotes

from release_notes.upload import UploadRelease, upload_release_notes


config = EnvConfig(".env")
github_api = GithubAPIConfig("DataWiz40", "gg-release-example", config)
prompt_config = PromptConfig(github_api)

prod_release_pr = ProdReleasePR(github_api)
release_version = ReleaseVersion(github_api)

release_notes_instance = ReleaseNotes(
    env_config=config, prompt_config=prompt_config, prod_release_pr=prod_release_pr
)

if __name__ == "__main__":
    generated_release_notes = release_notes_instance.create_release_notes()
    chosen_release = generated_release_notes.get("internal_release").get("response")
    upload_instance = UploadRelease(
        github_config=github_api,
        env_config=config,
        prod_release_pr=prod_release_pr,
        prod_release_version=release_version,
        release_notes_text=chosen_release,
    )
    upload_release_notes(
        prod_release_pr.issue_num, upload_instance, make_github_release=True
    )

Example Github Actions workflow

name: Generate Release notes

on:
  pull_request:
    types: [labeled]
    branches:
      - main
  workflow_dispatch:

jobs:
  test-release-notes:
    if: ${{ github.event.label.name == 'prod-release' }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.8"]
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python3 -m pip install --upgrade pip
          python3 -m pip install -r requirements.txt

      - name: Decode base64 env
        run: echo ${{ secrets.INSERT_SECRETS_KEY }} | base64 --decode > .env

      - name: Generate Release Notes
        run: python3 ./path_to_script.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gg-release-notes-1.7.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

gg_release_notes-1.7.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file gg-release-notes-1.7.1.tar.gz.

File metadata

  • Download URL: gg-release-notes-1.7.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.26.0 rfc3986/1.5.0 tqdm/4.64.0 urllib3/1.26.7 CPython/3.10.12

File hashes

Hashes for gg-release-notes-1.7.1.tar.gz
Algorithm Hash digest
SHA256 c650604c529fa53e2cec48c9b39134740efe94a2bd468dc029c03270612f9940
MD5 ba6892d9466135d07e8633d21b2f3106
BLAKE2b-256 879ec0b98eb0eb31665e320373acfc1aab241a44689dbdb19f774b280a44a30c

See more details on using hashes here.

File details

Details for the file gg_release_notes-1.7.1-py3-none-any.whl.

File metadata

  • Download URL: gg_release_notes-1.7.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.26.0 rfc3986/1.5.0 tqdm/4.64.0 urllib3/1.26.7 CPython/3.10.12

File hashes

Hashes for gg_release_notes-1.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e77fb95cf075ab44338370b9f48e414067dc39454146b9de9f8fc3dea58bcac
MD5 c09ca4e1f9adf44c3539f94edc5f601f
BLAKE2b-256 3dcc75bb32d631d1e0240b614569437c4a80d62476aea7803d56cbed78394725

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page