From 45bab4a7f324740256127c7ee65538c3187a343a Mon Sep 17 00:00:00 2001 From: Snigdhajyoti Ghosh Date: Thu, 16 Nov 2023 00:28:37 +0530 Subject: [PATCH] Publish 1.0 to PyPI --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/tagging.yml | 19 +++++++++++++++---- aws_fusion/__init__.py | 2 +- setup.py | 3 ++- 4 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b824be0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish to PyPI + +on: + release: + types: + - created + +concurrency: publish + +jobs: + build: + runs-on: ubuntu-latest + environment: pypi + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build and publish to PyPI + run: | + python setup.py sdist bdist_wheel + python -m twine upload dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/tagging.yml b/.github/workflows/tagging.yml index c2477ed..deb6e1d 100644 --- a/.github/workflows/tagging.yml +++ b/.github/workflows/tagging.yml @@ -1,6 +1,7 @@ -name: Tagging +name: Auto Tagging on: + workflow_dispatch: push: branches: - "main" @@ -31,9 +32,19 @@ jobs: - name: Get package information id: package_info run: | - echo "version=$(./setup.py --version)" >> "$GITHUB_OUTPUT" + current_version=$(./setup.py --version) + + tag_exist=false + if git rev-parse "refs/tags/v$current_version" >/dev/null 2>&1; then + echo "::warning title=Tag already exists::v${current_version}" + tag_exist=true + fi + + echo "tag=v${current_version}" >> "$GITHUB_OUTPUT" + echo "tag_exist=${tag_exist}" >> "$GITHUB_OUTPUT" - name: Add git tag + if: ${{ steps.package_info.outputs.tag_exist == 'false' }} run: | - git tag ${{ steps.package_info.outputs.version }} -f - git push origin ${{ steps.package_info.outputs.version }} -f + git tag ${{ steps.package_info.outputs.tag }} + git push origin ${{ steps.package_info.outputs.tag }} diff --git a/aws_fusion/__init__.py b/aws_fusion/__init__.py index 5a6f84c..7e49527 100644 --- a/aws_fusion/__init__.py +++ b/aws_fusion/__init__.py @@ -1 +1 @@ -__version__ = '0.5' +__version__ = '1.0' diff --git a/setup.py b/setup.py index bf450f3..a730fc9 100755 --- a/setup.py +++ b/setup.py @@ -82,6 +82,7 @@ class CustomInstallScriptsCommand(install_scripts): 'aws-auth' ], long_description=read("README.md"), + long_description_content_type='text/markdown', packages=find_packages(), cmdclass={ 'develop': CustomDevelopCommand, @@ -94,7 +95,7 @@ class CustomInstallScriptsCommand(install_scripts): }, install_requires=[ 'boto3>=1.29', - 'botocore>=1.32', + 'botocore>=1.29', 'pyperclip>=1.8', 'keyring>=24.3', 'beautifulsoup4>=4.12',