Skip to content

Minor changes to release instructions #12

Minor changes to release instructions

Minor changes to release instructions #12

Workflow file for this run

name: Publish release to PyPI
on:
release:
types: [released]
jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: cache poetry install
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-1.8.3-0
- uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: true
- name: cache deps
id: cache-deps
uses: actions/cache@v4
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- run: poetry install --no-interaction
- run: poetry build
- uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
permissions:
id-token: write
attestations: write
contents: read
environment:
name: PyPI
url: https://pypi.org/p/nsidc-metgenc
steps:
- uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Generate artifact attestation for sdist and wheel
uses: actions/[email protected]
with:
subject-path: "dist/*"
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/