Skip to content

Commit

Permalink
ci: trusted publisher (#919)
Browse files Browse the repository at this point in the history
* ci: sign files

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* ci: remove sigstore experiment

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Mar 28, 2024
1 parent 23bab22 commit 91e1dcd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 32 deletions.
37 changes: 9 additions & 28 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ on:
inputs:
overrideVersion:
description: Manually force a version
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
release:
types:
- published
Expand All @@ -35,19 +27,15 @@ jobs:
fetch-depth: 0
submodules: true

- name: Set version if needed
if: github.event.inputs.overrideVersion
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}" >> $GITHUB_ENV

- name: Build SDist
run: pipx run build --sdist

- name: Check metadata
run: pipx run twine check --strict dist/*
run: pipx run twine check --strict dist/*.tar.gz

- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
path: dist/*
name: wheels-sdist

build_arch_wheels:
Expand All @@ -63,11 +51,6 @@ jobs:
fetch-depth: 0
submodules: true

- name: Set version if needed
if: github.event.inputs.overrideVersion
shell: bash
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}" >> $GITHUB_ENV

- uses: docker/setup-qemu-action@v3.0.0
with:
platforms: all
Expand All @@ -84,7 +67,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
path: wheelhouse/*
name: wheel-aarch-${{ strategy.job-index }}

build_wheels:
Expand All @@ -109,11 +92,6 @@ jobs:
fetch-depth: 0
submodules: true

- name: Set version if needed
if: github.event.inputs.overrideVersion
shell: bash
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}" >> $GITHUB_ENV

- uses: pypa/cibuildwheel@v2.17
env:
CIBW_BUILD: ${{ matrix.build }}
Expand All @@ -133,6 +111,12 @@ jobs:
name: Upload if release
needs: [build_wheels, build_arch_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: pypi
url: https://pypi.org/p/boost-histogram
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
Expand All @@ -145,6 +129,3 @@ jobs:
run: ls -lh dist

- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.action == 'published'
with:
password: ${{ secrets.pypi_password }}
13 changes: 9 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: shellcheck
exclude: ^docs/notebooks/conf.sh$
- id: check-readthedocs
- id: check-github-workflows

- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2024.03.25
hooks:
- id: validate-pyproject

0 comments on commit 91e1dcd

Please sign in to comment.