Debian Codegraph @

.github/workflows/release_to_pypi.yml

raw symbols SCIP
1 name: Publish contextily to PyPI / GitHub
2
3 on:
4 push:
5 tags:
6 - "v*"
7
8 jobs:
9 build-n-publish:
10 name: Build and publish contextily to PyPI
11 runs-on: ubuntu-latest
12
13 steps:
14 - name: Checkout source
15 uses: actions/checkout@v4
16
17 - name: Set up Python
18 uses: actions/setup-python@v5
19 with:
20 python-version: "3.x"
21
22 - name: Build a binary wheel and a source tarball
23 run: |
24 python -m pip install --upgrade build
25 python -m build
26
27 - name: Publish distribution to PyPI
28 uses: pypa/gh-action-pypi-publish@release/v1
29 with:
30 user: __token__
31 password: ${{ secrets.PYPI_API_TOKEN }}
32
33 - name: Create GitHub Release
34 id: create_release
35 uses: actions/create-release@v1
36 env:
37 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
38 with:
39 tag_name: ${{ github.ref }}
40 release_name: ${{ github.ref }}
41 draft: false
42 prerelease: false
43
44 - name: Get Asset name
45 run: |
46 export PKG=$(ls dist/ | grep tar)
47 set -- $PKG
48 echo "name=$1" >> $GITHUB_ENV
49
50 - name: Upload Release Asset (sdist) to GitHub
51 id: upload-release-asset
52 uses: actions/upload-release-asset@v1
53 env:
54 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 with:
56 upload_url: ${{ steps.create_release.outputs.upload_url }}
57 asset_path: dist/${{ env.name }}
58 asset_name: ${{ env.name }}
59 asset_content_type: application/zip