Skip to content

Commit

Permalink
workflows: add pypi publish and auto release generation (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Avik Basu <[email protected]>
  • Loading branch information
ab93 authored Aug 16, 2022
1 parent 040584f commit 6847211
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PyPi Publish

on:
push:
tags:
- v*
jobs:
pypi_publish:
if: github.repository == 'numaproj/numalogic'
runs-on: ubuntu-latest
environment: production
strategy:
fail-fast: false
matrix:
python-version: [ "3.9" ]

name: Publish to PyPi
steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install dependencies
run: |
poetry env use ${{ matrix.python-version }}
poetry install --no-root
- name: Build dist
run: poetry build

- name: Publish
run: poetry publish -u __token__ -p {{ secrets.PYPI_PASSWORD }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Generate release version

on:
push:
tags:
- v*

jobs:
generate_release:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0

- name: Generate changelog
- run: git fetch --prune --prune-tags
- run: git tag -l 'v*'
- run: ./.hack/changelog.sh > ${{ github.workspace }}-_CHANGELOG.txt

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: ${{ github.workspace }}-_CHANGELOG.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# numalogic

[![Build](https://github.com/numaproj/numalogic/actions/workflows/ci.yml/badge.svg)](https://github.com/numaproj/numalogic/actions/workflows/ci.yml)
[![Coverage](https://github.com/numaproj/numalogic/actions/workflows/coverage.yml/badge.svg?branch=main)](https://github.com/numaproj/numalogic/actions/workflows/coverage.yml)
[![codecov](https://codecov.io/gh/numaproj/numalogic/branch/main/graph/badge.svg?token=020HF97A32)](https://codecov.io/gh/numaproj/numalogic)
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)


Expand Down

0 comments on commit 6847211

Please sign in to comment.