Skip to content

Commit

Permalink
Use more streamlined publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
parafoxia committed Nov 4, 2021
1 parent cf6891e commit c6b2754
Showing 1 changed file with 29 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
run: |
[[ $(sed -rn 's/__version__ = "(.*)"/v\1/p' len8/__init__.py) == ${{ github.event.release.tag_name }} ]]
package:
name: Publish package
build:
name: Build package
needs: check-version
runs-on: ubuntu-latest

Expand All @@ -29,7 +29,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: "3.x"

- name: Install dependencies
run: |
Expand All @@ -38,32 +38,41 @@ jobs:
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
- name: Upload artefacts to workflow
uses: actions/upload-artifact@v2
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
name: artefacts
path: dist/

artefacts:
name: Publish artefacts
needs: check-version
publish:
name: Publish package
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artefacts
uses: actions/download-artifact@v2
with:
name: artefacts
path: dist/

- name: Set up Python
uses: actions/setup-python@v2
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
python-version: '3.x'
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Install dependencies
run: |
python -m pip install build
attach:
name: Attach artefacts to release
needs: build
runs-on: ubuntu-latest

- name: Build artefacts
run: python -m build
steps:
- name: Download artefacts
uses: actions/download-artifact@v2
with:
name: artefacts
path: dist/

- name: Attach artefacts to release
uses: svenstaro/upload-release-action@v2
Expand Down

0 comments on commit c6b2754

Please sign in to comment.