Skip to content

Commit

Permalink
Use publish flow to match other pypis
Browse files Browse the repository at this point in the history
  • Loading branch information
paulannetts committed Oct 7, 2024
1 parent 1b6fd61 commit 2dd7e40
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ on:
push:
branches:
- master
tags:
- '*'
pull_request:
workflow_call:

Expand Down Expand Up @@ -88,30 +86,3 @@ jobs:
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist

# release:
# name: Release
# runs-on: ubuntu-latest
# if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
# needs: [linux, macos, sdist]
# permissions:
# # Use to sign the release artifacts
# id-token: write
# # Used to upload release artifacts
# contents: write
# # Used to generate artifact attestation
# attestations: write
# steps:
# - uses: actions/download-artifact@v4
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-path: 'wheels-*/*'
# - name: Publish to PyPI
# if: "startsWith(github.ref, 'refs/tags/')"
# uses: PyO3/maturin-action@v1
# env:
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
# with:
# command: upload
# args: --non-interactive --skip-existing wheels-*/*
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Wheels

on:
release:
types: [published]

permissions:
contents: read

jobs:
run-build-workflow:
uses: ./.github/workflows/build.yml

pypi-publish:
name: Publish to PyPi
needs: run-build-workflow
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist/
- name: List artifacts downloaded
run: ls -R dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.8

0 comments on commit 2dd7e40

Please sign in to comment.