From ce1be7c3e39b0bb6ebe5d3652c215129f04f8053 Mon Sep 17 00:00:00 2001 From: Shady Baseely <75696750+baseely@users.noreply.github.com> Date: Wed, 3 Jan 2024 00:47:29 +0200 Subject: [PATCH 1/3] Create main.yml --- .github/workflows/main.yml | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7d42c78 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,49 @@ +name: Publish to PyPI +on: + push: + tags: + - '*' + +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade setuptools wheel + pip install --upgrade twine + + - name: Build and publish wheel + run: | + python -m build + twine upload dist/*.whl + + build: + name: Build distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade setuptools wheel + pip install --upgrade twine + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From cc699d9a4336bb28df79919b0d35e358bf19ada3 Mon Sep 17 00:00:00 2001 From: Shady Baseely <75696750+baseely@users.noreply.github.com> Date: Wed, 3 Jan 2024 00:58:16 +0200 Subject: [PATCH 2/3] Update main.yml Add new workflow stub from the official GH Actions --- .github/workflows/main.yml | 68 ++++++++++++++------------------------ 1 file changed, 25 insertions(+), 43 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7d42c78..9c893f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,49 +1,31 @@ -name: Publish to PyPI -on: - push: - tags: - - '*' - -jobs: - pypi-publish: - name: Upload release to PyPI - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 +=name: Upload Python Package to PyPI - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 +on: + release: + types: [published] - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade setuptools wheel - pip install --upgrade twine +permissions: + contents: read - - name: Build and publish wheel - run: | - python -m build - twine upload dist/*.whl +jobs: + deploy: - build: - name: Build distribution runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade setuptools wheel - pip install --upgrade twine - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - uses: actions/checkout@v3 + - 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 + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From a643ebf60c578800a99492bd70d72d1d79cd8249 Mon Sep 17 00:00:00 2001 From: Shady Baseely <75696750+baseely@users.noreply.github.com> Date: Wed, 3 Jan 2024 00:59:48 +0200 Subject: [PATCH 3/3] Update main.yml Fix a typo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c893f1..87190a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -=name: Upload Python Package to PyPI +name: Upload Python Package to PyPI on: release: