diff --git a/.github/workflows/python_package.yaml b/.github/workflows/python_package.yaml index d9f8cf9..31cc304 100644 --- a/.github/workflows/python_package.yaml +++ b/.github/workflows/python_package.yaml @@ -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 @@ -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/*