2022-01-05 13:22:52 -07:00
|
|
|
name: Build python-awips and Publish for pip
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build Release Packages
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2025-02-13 11:40:19 -07:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-05 13:22:52 -07:00
|
|
|
- name: Set up Python
|
|
|
|
id: setup
|
2025-02-13 11:40:19 -07:00
|
|
|
uses: actions/setup-python@v4
|
2022-01-05 13:22:52 -07:00
|
|
|
with:
|
|
|
|
python-version: 3.x
|
|
|
|
|
|
|
|
- name: Install build tools
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
2025-02-13 11:45:51 -07:00
|
|
|
python -m pip install --upgrade build
|
2022-01-05 13:22:52 -07:00
|
|
|
python -m pip install --upgrade setuptools
|
|
|
|
- name: Build packages
|
2025-02-13 11:22:17 -07:00
|
|
|
run: python -m build
|
2022-01-05 13:22:52 -07:00
|
|
|
|
|
|
|
- name: Save built packages as artifact
|
2025-02-13 11:40:19 -07:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-01-05 13:22:52 -07:00
|
|
|
with:
|
|
|
|
path: dist/
|
|
|
|
retention-days: 5
|
|
|
|
|
|
|
|
publish:
|
|
|
|
name: Publish to PyPI
|
|
|
|
needs: build
|
|
|
|
environment:
|
|
|
|
name: PyPI
|
|
|
|
url: https://pypi.org/project/python-awips/
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download packages
|
2025-02-13 11:40:19 -07:00
|
|
|
uses: actions/download-artifact@v4
|
2022-01-05 13:22:52 -07:00
|
|
|
with:
|
|
|
|
path: ./dist
|
2022-01-05 15:35:35 -08:00
|
|
|
name: artifact
|
2022-01-05 13:22:52 -07:00
|
|
|
|
|
|
|
- name: Publish Package
|
|
|
|
uses: pypa/gh-action-pypi-publish@v1.4.2
|
|
|
|
with:
|
|
|
|
user: __token__
|
|
|
|
password: ${{ secrets.PYPI_TOKEN }}
|