Skip to content

Commit

Permalink
Ready for Publish
Browse files Browse the repository at this point in the history
- Added publish.yml
  • Loading branch information
fasilwdr committed Aug 8, 2024
1 parent d804e17 commit ae1fc58
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# .github/workflows/publish.yml
name: Publish Python Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include README.md
include LICENSE
include md2indexhtml/templates/*.html
2 changes: 1 addition & 1 deletion md2indexhtml/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ def main():
convert_md_to_html(args.md_file_path, args.output_dir, args.template, args.css, args.title)

if __name__ == '__main__':
main()
main()
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# setup.py

from setuptools import setup, find_packages

setup(
Expand All @@ -25,7 +24,7 @@
],
},
package_data={
'md2indexhtml': ['templates/*.html'], # Include all HTML files in the templates directory
'md2indexhtml': ['templates/*.html'],
},
include_package_data=True, # This flag is needed to include the data specified in package_data
include_package_data=True,
)

0 comments on commit ae1fc58

Please sign in to comment.