Skip to content

Commit

Permalink
Cleanup the GHA workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenbeam committed Nov 26, 2024
1 parent 4a38e4c commit 1d0f0c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Build & test
on:
push:
branches: [main]
pull_request:

jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/workflow.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Build & publish to PyPI
name: Publish release to PyPI

on:
workflow_dispatch:
pull_request:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
release:
types: [released]

jobs:
build:
Expand Down Expand Up @@ -46,25 +43,25 @@ jobs:

- uses: actions/upload-artifact@v4
with:
path: dist
name: release-dists
path: dist/

publish:
if: github.ref_type == 'tag'
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
environment:
name: PyPI
url: https://pypi.org/p/nsidc-metgenc
permissions:
id-token: write
attestations: write
contents: read
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/p/nsidc-metgenc
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
name: release-dists
path: dist/

- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v1.4.3
Expand All @@ -73,3 +70,5 @@ jobs:

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/

0 comments on commit 1d0f0c3

Please sign in to comment.