-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.85 KB
/
Copy pathrelease.yml
File metadata and controls
56 lines (47 loc) · 1.85 KB
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
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
name: Release
# IMPORTANT: PyPI validates against the filename (release.yml),
# the owner, and the repo registered in the Trusted Publisher. If you change
# the filename, update the registration on pypi.org.
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
workflow_dispatch:
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 20
environment: pypi # Must exist in GitHub AND be registered in PyPI
permissions:
id-token: write # OIDC: mandatory for Trusted Publishing
contents: read
steps:
# The hashes correspond to the most recent versions at the time of this
# analysis; update via Dependabot (see dependabot.yml).
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.11'
cache: 'pip'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build setuptools wheel
- name: Build distribution
run: python -m build --sdist --wheel
# Trusted Publishing: no password required. The action obtains an ephemeral
# OIDC token signed by GitHub, which PyPI validates against the
# registered publisher. There are no secrets to rotate or leak.
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
# attestations: true # optional: generate PEP 740 attestations (supply chain)