Merge pull request #169 from noaa-ocs-modeling/depend/stormevent_225 #184
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: build | |
on: | |
push: | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
name: build package | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
- name: install Poetry | |
uses: abatilo/[email protected] | |
- name: install Dunamai | |
run: pip install dunamai | |
- name: extract version from VCS | |
run: poetry version $(dunamai from any) | |
- name: build wheel and source | |
run: poetry build | |
- name: save builds | |
uses: actions/upload-artifact@v3 | |
with: | |
name: repo_w_build | |
path: . | |
publish_dry: | |
needs: build | |
name: dry-run publishing package to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: retrieve wheel(s) and source | |
uses: actions/download-artifact@v3 | |
with: | |
name: repo_w_build | |
path: . | |
- name: install Poetry | |
uses: abatilo/[email protected] | |
- name: upload wheel and source | |
run: poetry publish --dry-run --username __token__ --password ${{ secrets.PYPI_TOKEN }} | |
publish: | |
needs: build | |
if: github.event_name == 'release' | |
name: publish package to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: retrieve wheel(s) and source | |
uses: actions/download-artifact@v3 | |
with: | |
name: repo_w_build | |
path: . | |
- name: install Poetry | |
uses: abatilo/[email protected] | |
- name: upload wheel and source | |
run: poetry publish --username __token__ --password ${{ secrets.PYPI_TOKEN }} |