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
Release history Release notifications | RSS feed
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.0.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for gg_release_notes-1.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbea0fc8f14de2a1de02a8958774b88959494b795303edeb6dc61e302f7b0933 |
|
MD5 | 40da85a0efc720490c6fe18d6db8c708 |
|
BLAKE2b-256 | bb0520d6cfee31885005de33a1e7a6df72d133c7b4ae61859e270d490228e344 |