mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-16 08:38:30 +00:00
Add source distribution and upload jobs (#2203)
This commit is contained in:
parent
94fbe79f44
commit
135dbf8777
1 changed files with 41 additions and 5 deletions
46
.github/workflows/wheel.yml
vendored
46
.github/workflows/wheel.yml
vendored
|
|
@ -1,8 +1,8 @@
|
|||
name: "Create Python Wheels"
|
||||
name: "Create Python distributions and upload to PyPI"
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ created ]
|
||||
types: [ published ]
|
||||
workflow_dispatch: {}
|
||||
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ env:
|
|||
|
||||
jobs:
|
||||
make-wheels:
|
||||
name: ${{ matrix.os }}
|
||||
name: Make ${{ matrix.os }} wheels
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -46,7 +46,43 @@ jobs:
|
|||
CIBW_TEST_COMMAND: pytest --pyargs prophet
|
||||
|
||||
- name: "Upload wheel as artifact"
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.os }}-wheel
|
||||
name: artifact-${{ matrix.os }}-wheel
|
||||
path: "./**/*.whl"
|
||||
|
||||
make-sdist:
|
||||
name: Make source distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- run: pipx run build --sdist
|
||||
working-directory: python
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: artifact-source-dist
|
||||
path: "./**/dist/*.tar.gz"
|
||||
|
||||
upload:
|
||||
name: Upload to PyPI
|
||||
needs: [make-wheels, make-sdist]
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
- name: Copy artifacts to dist/ folder
|
||||
run: |
|
||||
find . -name 'artifact-*' -exec unzip '{}' \;
|
||||
mkdir -p dist/
|
||||
find . -name '*.tar.gz' -exec mv '{}' dist/ \;
|
||||
find . -name '*.whl' -exec mv '{}' dist/ \;
|
||||
|
||||
- name: Upload
|
||||
uses: pypa/gh-action-pypi-publish@v1.4.2
|
||||
with:
|
||||
user: ${{ secrets.PYPI_USERNAME }}
|
||||
password: ${{ secrets.PYPI_PASSWORD }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue