-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First release on pypi
- Loading branch information
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
import os | ||
import sys | ||
import argparse | ||
from pythorhead import Lemmy | ||
|
||
|
||
arg_parser = argparse.ArgumentParser() | ||
arg_parser.add_argument( | ||
"version", | ||
action="store", | ||
help="The version being released", | ||
) | ||
args = arg_parser.parse_args() | ||
|
||
bot_password = os.getenv("LEMMY_BOT_PASSWORD") | ||
if not bot_password: | ||
print("Bot password not set") | ||
sys.exit(1) | ||
lemmy = Lemmy("https://lemmy.dbzer0.com") | ||
lemmy.log_in("div0", bot_password) | ||
community_id = lemmy.discover_community("fediseer") | ||
lemmy.post.create( | ||
community_id, | ||
f"New Pythonseer release {args.version}", | ||
url=f"https://github.com/db0/pythonseer/releases/tag/{args.version}", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Pythonseer build and publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Pythonseer 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@v0.28.0 | ||
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 }} | ||
|
||
- name: "🤖 Announce on lemmy.dbzer0.com" | ||
if: ${{ steps.release.outputs.version != '' }} | ||
run: | | ||
python -m pip install -e . | ||
python .github/publish_on_lemmy.py ${{ steps.release.outputs.version }} | ||
env: | ||
LEMMY_BOT_PASSWORD: ${{ secrets.LEMMY_BOT_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Changelog | ||
First release |