Skip to content

Commit

Permalink
Add release flow with publishing to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
b0g3r committed May 2, 2021
1 parent 715d54c commit bbb3793
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

#on:
# release:
# types:
# - 'published'

on:
push:

env:
PYTHON_VERSION: 3.9

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Set up Python 🐍
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Cache Poetry virtualenv 💾
uses: actions/cache@v1
id: poetry-cache
with:
path: .venv
key: poetry-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}

- name: Install Poetry 📖
run: |
pip install poetry
poetry config virtualenvs.in-project true
- name: Install dependencies 📌
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: |
poetry install
- name: Build package 📦
run: |
poetry run scripts/build.sh
- name: Upload package build to artifacts ☁️
uses: actions/upload-artifact@v2
with:
name: package
path: dist
if-no-files-found: error

- name: Publish package ⬆️
run: |
poetry run scripts/publish.sh
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "eventual"
version = "0.4.1"
version = "0.4.1a1"
description = ""
authors = ["Ivan Dmitriesvkii <ivan.dmitrievsky@gmail.com>"]

Expand Down
1 change: 0 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
set -x

poetry build
mkdocs build
5 changes: 5 additions & 0 deletions scripts/docs-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -e

set -x

poetry build
File renamed without changes.
5 changes: 5 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -e

set -x

poetry publish

0 comments on commit bbb3793

Please sign in to comment.