From 7771e9c2ddabc1c47e0fca6a171c8c2f829706be Mon Sep 17 00:00:00 2001 From: Indrajith Indraprastham Date: Thu, 13 Jun 2024 02:23:49 +0530 Subject: [PATCH 1/6] python publish workflow --- .github/workflows/python-publish.yml | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..df04ec7 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,30 @@ +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@v1.5.1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file From 08a711edcdea3f29ab8da6ad73f0b3220e335ef4 Mon Sep 17 00:00:00 2001 From: Indrajith Indraprastham Date: Thu, 13 Jun 2024 02:27:29 +0530 Subject: [PATCH 2/6] update workflow trigger for publish --- .github/workflows/python-publish.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index df04ec7..a79a87d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,8 +1,13 @@ name: Upload Python Package +# on: +# release: +# types: [published] + on: - release: - types: [published] + push: + branches: + - feature/deploy permissions: contents: read From b152e8d35e249394baa5de2e8432f3c2f63e579c Mon Sep 17 00:00:00 2001 From: Indrajith Indraprastham Date: Thu, 13 Jun 2024 02:37:36 +0530 Subject: [PATCH 3/6] log secret for workflow --- .github/workflows/python-publish.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index a79a87d..90ecfb4 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,13 +1,9 @@ name: Upload Python Package -# on: -# release: -# types: [published] - on: push: branches: - - feature/deploy + - main # Change this to your branch for testing permissions: contents: read @@ -15,6 +11,7 @@ permissions: jobs: deploy: runs-on: ubuntu-latest + environment: publish-pip # Specify the environment here steps: - uses: actions/checkout@v4 @@ -28,8 +25,13 @@ jobs: pip install build twine - name: Build package run: python -m build + - name: Debug Secret + run: | + echo "PYPI_API_TOKEN starts with ${PYPI_API_TOKEN:0:2} and ends with ${PYPI_API_TOKEN: -2}" + env: + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - name: Publish package - uses: pypa/gh-action-pypi-publish@v1.5.1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: python -m twine upload --verbose dist/* From c6822b3337cb570d0a416f38a2d2844c4fcf288f Mon Sep 17 00:00:00 2001 From: Indrajith Indraprastham Date: Thu, 13 Jun 2024 02:39:35 +0530 Subject: [PATCH 4/6] log secret for workflow --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 90ecfb4..a3652bd 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,7 +3,7 @@ name: Upload Python Package on: push: branches: - - main # Change this to your branch for testing + - feature/deploy # Change this to your branch for testing permissions: contents: read From 38d5eb6226c1f2fcb22d0bce1bc9cee8657f685d Mon Sep 17 00:00:00 2001 From: Indrajith Indraprastham Date: Thu, 13 Jun 2024 02:41:32 +0530 Subject: [PATCH 5/6] publish workflow --- .github/workflows/python-publish.yml | 5 ----- setup.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index a3652bd..cda8f80 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -25,11 +25,6 @@ jobs: pip install build twine - name: Build package run: python -m build - - name: Debug Secret - run: | - echo "PYPI_API_TOKEN starts with ${PYPI_API_TOKEN:0:2} and ends with ${PYPI_API_TOKEN: -2}" - env: - PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - name: Publish package env: TWINE_USERNAME: __token__ diff --git a/setup.py b/setup.py index 641e0a0..95375dd 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="tiny-web-crawler", # PyPI package name - version="0.1.1", + version="0.1.2", author="Indrajith Indraprastham", author_email="indr4jith@gmail.com", description="A simple and efficient web crawler in Python.", From b9fe38b017f58942445aef0da2fcb8854f94a3a3 Mon Sep 17 00:00:00 2001 From: Indrajith Indraprastham Date: Thu, 13 Jun 2024 02:43:12 +0530 Subject: [PATCH 6/6] publish workflow release --- .github/workflows/python-publish.yml | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index cda8f80..97bad67 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,9 +1,9 @@ name: Upload Python Package on: - push: - branches: - - feature/deploy # Change this to your branch for testing + release: + types: [published] + permissions: contents: read diff --git a/setup.py b/setup.py index 95375dd..82182ec 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="tiny-web-crawler", # PyPI package name - version="0.1.2", + version="0.1.3", author="Indrajith Indraprastham", author_email="indr4jith@gmail.com", description="A simple and efficient web crawler in Python.",