-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
82 lines (70 loc) · 2.71 KB
/
wheel_tests_and_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build Wheels and Release
on:
push:
tags:
- v*
branches:
- maintenance/**
concurrency:
# Cancel previous workflows on the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
call-workflow-build-wheels:
uses: ./.github/workflows/wheels_recipe.yml
deploy:
name: Release
needs: call-workflow-build-wheels
if: github.repository_owner == 'scikit-image' && startsWith(github.ref, 'refs/tags/v') && always()
runs-on: ubuntu-latest
environment: release
permissions:
contents: write # for softprops/action-gh-release to create GitHub release
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
attestations: write # for GitHub attestations
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"
- uses: actions/download-artifact@v3
id: download
with:
name: wheels
path: ./dist
- name: Build the source distribution
run: |
SK_VERSION=$(git describe --tags)
source tools/github/before_install.sh
python -m build --no-isolation --skip-dependency-check --sdist .
ls -la ${{ github.workspace }}/dist
- name: Generate artifact attestation for sdist and wheels
uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
with:
subject-path: "dist/scikit_image-*"
- name: Verify the distribution
run: pipx run twine check --strict dist/*
# Ensure that a compromised twine couldn't have altered the distributions
# Required to resolve sdist and wheels separately
- name: Verify sdist artifact attestation
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh attestation verify dist/scikit_image-*.tar.gz --repo ${{ github.repository }}
- name: Verify wheel artifact attestation
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh attestation verify dist/scikit_image-*.whl --repo ${{ github.repository }}
# We prefer to release wheels before source because otherwise there is a
# small window during which users who pip install scikit-image will require compilation.
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
- name: Github release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}