Skip to content

Commit

Permalink
Merge pull request #1 from db0/release
Browse files Browse the repository at this point in the history
release: pypi
  • Loading branch information
db0 authored Jun 14, 2023
2 parents f549310 + 7730f97 commit e181841
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 7 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Pythörhead build and publish

on:
push:
branches:
- main

jobs:
build-n-publish:
name: Pythörhead build and publish
runs-on: ubuntu-latest
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "📣 Release on push"
id: release
uses: rymndhng/release-on-push-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bump_version_scheme: norelease
use_github_release_notes: true
- name: "✏️ Generate release changelog"
if: ${{ steps.release.outputs.version != '' }}
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: "💾 Commit new version"
if: ${{ steps.release.outputs.version != '' }}
run: |
sed -i 's/^version = ".*"/version = "${{ steps.release.outputs.version }}"/g' ./pyproject.toml
git config user.email github-actions@github.com
git config user.name github-actions
git commit -am 'version incremented'
git push
- name: "🐍 Set up Python 3.10"
if: ${{ steps.release.outputs.version != '' }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: "🛠 Install pypa/build"
if: ${{ steps.release.outputs.version != '' }}
run: >-
python -m
pip install
build
--user
- name: "🔧 Build a binary wheel and a source tarball"
if: ${{ steps.release.outputs.version != '' }}
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: "📦 Publish distribution to PyPI"
if: ${{ steps.release.outputs.version != '' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description = "A python library for interacting with Lemmy API"
authors = [
{name = "db0", email = "mail@dbzer0.com"},
]
version = "v0.0.1"
readme = "README.md"
requires-python = ">=3.8,<3.11"
license = { file="LICENSE" }
Expand All @@ -18,19 +19,12 @@ classifiers = [
"Development Status :: 2 - Pre-Alpha",
]

dynamic=["version"]

[project.urls]
"Homepage" = "https://github.com/db0/pythorhead"

[tool.setuptools]
license-files = ["LICENSE", "CHANGELOG*"]

[tool.setuptools_scm]
# Don't create a _version file in development mode
# We uncomment this automatically at build time.
#write_to = "pythorhead/_version.py"

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

Expand Down

0 comments on commit e181841

Please sign in to comment.