Skip to content

Commit

Permalink
minor update on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
abedinia committed Jul 19, 2024
1 parent 53e0a34 commit 9d753d5
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/python_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ jobs:
pip install pytest
pytest
- name: Upload package artifact
uses: actions/upload-artifact@v2
with:
name: db-weights-wheel
path: dist/*.whl

release:
needs: build
runs-on: ubuntu-latest
Expand All @@ -48,24 +54,37 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
- name: Download package artifact
uses: actions/download-artifact@v2
with:
python-version: '3.x'
name: db-weights-wheel
path: dist

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Build the package
run: |
python setup.py sdist bdist_wheel
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/*.whl
asset_name: db_weights-${{ github.ref }}.whl
asset_content_type: application/zip

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pip install --upgrade twine
twine upload dist/*

0 comments on commit 9d753d5

Please sign in to comment.