-
Notifications
You must be signed in to change notification settings - Fork 27
56 lines (50 loc) · 1.62 KB
/
_pypi_test_publish.yaml
File metadata and controls
56 lines (50 loc) · 1.62 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
# -*- mode: yaml; coding: utf-8 -*-
# Copyright (C) 2024 Benjamin Thomas Schwertfeger
# All rights reserved.
# 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@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
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@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
with:
password: ${{ secrets.API_TOKEN }}
repository-url: https://test.pypi.org/legacy/