-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (44 loc) · 1.47 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Upload package to PyPI
on:
release:
types: [created]
jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install setuptools_scm
run: pip install setuptools_scm
- name: Write version to file
run: python -c "import setuptools_scm; print(f'__version__ = \\'{setuptools_scm.get_version()}\\'', file=open('coloc_sat/version.py', 'w'))"
- name: Update system package index
run: sudo apt update
- name: Install system packages
run: sudo apt-get install -y libgdal-dev
- name: Setup Environment Variables
run: echo "GDAL_CONFIG=/usr/bin/gdal-config" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip build twine
pip install GDAL==`gdal-config --version`
- name: Build
run: |
python -m build --sdist --wheel .
- name: Check the built archives
run: |
twine check dist/*
pip install dist/*.whl
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
with:
password: ${{ secrets.pypi_token }}
repository_url: https://upload.pypi.org/legacy/
verify_metadata: true