Skip to content

Commit

Permalink
add auto release!
Browse files Browse the repository at this point in the history
  • Loading branch information
lzgirlcat committed Oct 4, 2024
1 parent a8e5a28 commit 48ef100
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
paths:
- 'setup.py'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -34,16 +37,23 @@ jobs:
if: env.VERSION!=env.LATEST_RELEASE
id: create_release
run: |
new_tag="v${VERSION}"
previous_tag="${LATEST_RELEASE}"
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "'"${new_tag}"'",
"tag_name": "'"${{ env.VERSION }}"'",
"target_commitish": "'"${{ github.sha }}"'",
"name": "'"${{ github.event.head_commit.message }}"'",
"body": "**Full Changelog**: https://github.com/lzgirlcat/koleo-cli/compare/${previous_tag}..${new_tag}",
"generate_release_notes": true,
"draft": false,
"prerelease": false
"prerelease": false,
}' https://api.github.com/repos/${{ github.repository }}/releases
- name: Build package
if: env.VERSION!=env.LATEST_RELEASE
run: python setup.py bdist_wheel sdist
- name: Publish package
if: env.VERSION!=env.LATEST_RELEASE
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ name: Upload Python Package
on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def parse_requirements_file(path):
entry_points={"console_scripts": ["koleo = koleo.cli:main"]},
install_requires=parse_requirements_file("requirements.txt"),
include_package_data=True,
keywords=["koleo", "timetable", "trains", "rail", "poland", "pociągi"],
keywords=["koleo", "timetable", "trains", "rail", "poland"],
project_urls={
"Source (GitHub)": "https://github.com/lzgirlcat/koleo-cli",
"Issue Tracker": "https://github.com/lzgirlcat/koleo-cli/issues",
Expand Down

0 comments on commit 48ef100

Please sign in to comment.