Skip to content

Commit

Permalink
Update pypi-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanjainn authored Aug 24, 2023
1 parent c67a6b6 commit a39b34d
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,71 @@ name: PYPI Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version number to release'
required: true

permissions:
contents: read

jobs:
deploy:

publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Create a new pyproject.toml
run: |
cat <<EOF > pyproject.toml
[tool.poetry]
name = "grafana-openai-monitoring"
version = "${{ github.event.inputs.version }}"
description = "Library to monitor your OpenAI usage and send metrics and logs to Grafana Cloud"
authors = ["Ishan Jain <[email protected]>"]
repository = "https://github.com/grafana/grafana-openai-monitoring"
readme = "README.md"
homepage = "https://github.com/grafana/grafana-openai-monitoring"
keywords = ["observability", "monitoring", "openai", "grafana", "gpt"]
[tool.poetry.dependencies]
python = "^3.7.1"
requests = "^2.26.0"
[build-system]
requires = ["poetry-core>=1.1.0"]
build-backend = "poetry.core.masonry.api"
EOF
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [publish]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}

0 comments on commit a39b34d

Please sign in to comment.