2023.09.0 #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Package to PyPI | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
name: Build packages | |
runs-on: ubuntu-latest | |
if: github.repository == 'umr-lops/xsar' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build twine | |
- name: Build | |
run: | | |
python -m build --sdist --outdir dist/ . | |
- name: Check the built archives | |
run: | | |
twine check dist/* | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages | |
path: dist/* | |
pypi-publish: | |
name: Upload to PyPI | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: pypi | |
url: https://pypi.org/p/xsar | |
permissions: | |
id-token: write | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: packages | |
path: dist/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e |