-
Notifications
You must be signed in to change notification settings - Fork 299
114 lines (95 loc) · 3.47 KB
/
Copy pathpublish.yml
File metadata and controls
114 lines (95 loc) · 3.47 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Publish to PyPI
on:
push:
tags:
- "v*.*.*"
permissions:
contents: read
jobs:
build:
name: Build distributions
runs-on: hl-sdk-py-lin-md
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- name: Upgrade pip
run: pip install "pip==26.0.1"
- name: Install build, pdm-backend, and grpcio-tools
run: pip install build pdm-backend "grpcio-tools==1.76.0"
- name: Generate Protobuf
run: python generate_proto.py
- name: Build wheel and sdist
run: python -m build
- name: Upload distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: dist/*
if-no-files-found: error
publish-and-sign:
name: Publish and sign release artifacts
needs: build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
runs-on: hl-sdk-py-lin-md
environment:
name: pypi
url: https://pypi.org/p/hiero-sdk-python
permissions:
contents: write
id-token: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- name: Download distributions
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist
- name: Sign release distributions with Sigstore
uses: sigstore/gh-action-sigstore-python@04cffa1d795717b140764e8b640de88853c92acc # v3.3.0
with:
inputs: |
dist/*.whl
dist/*.tar.gz
verify: true
verify-cert-identity: https://github.com/${{ github.repository }}/.github/workflows/publish.yml@refs/tags/${{ github.ref_name }}
verify-oidc-issuer: https://token.actions.githubusercontent.com
- name: Prepare distributions for PyPI upload
run: |
mkdir -p publish-dist
cp dist/*.whl publish-dist/
cp dist/*.tar.gz publish-dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
with:
packages-dir: publish-dist
skip-existing: true
- name: Upload signed assets to GitHub Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
with:
body: |
## Important notes
- See https://github.com/hiero-ledger/hiero-sdk-python/milestones for the pull requests included in this milestone.
- This release includes auto-generated release notes.
files: |
dist/*.whl
dist/*.tar.gz
dist/*.sigstore.json
fail_on_unmatched_files: true
generate_release_notes: true