-
Notifications
You must be signed in to change notification settings - Fork 19
55 lines (49 loc) · 1.59 KB
/
_pypi_test_publish.yaml
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
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Benjamin Thomas Schwertfeger
# GitHub: https://github.com/btschwertfeger
#
# Template workflow to build the project and publish
# the package to test PyPI.
#
name: PyPI Publish
on:
workflow_call:
secrets:
API_TOKEN:
required: true
permissions: read-all
jobs:
publish-to-test-pypi:
name: Publish Python distribution to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for OIDC publishing
environment:
name: testpypi
url: https://test.pypi.org/p/python-kraken-sdk
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
fulcio.sigstore.dev
ghcr.io
github.com:443
pkg-containers.githubusercontent.com:443
rekor.sigstore.dev
test.pypi.org
tuf-repo-cdn.sigstore.dev
uploads.github.com:443
- name: Download all the distributions
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # release/v1
with:
password: ${{ secrets.API_TOKEN }}
repository-url: https://test.pypi.org/legacy/