-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (37 loc) · 1.26 KB
/
publish.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
name: Publish Python 🐍 distributions 📦 to PyPI
on:
release:
types: [published]
jobs:
pypi-publish:
name: Build and publish Python 🐍 distributions 📦 to ${{ matrix.environment.name }}
runs-on: ubuntu-latest
strategy:
matrix:
environment:
- name: testpypi
url: https://test.pypi.org/project/behave-cucumber-matcher
token: TEST_PYPI_API_TOKEN
repository-url: https://test.pypi.org/legacy/
# - name: pypi
# url: https://pypi.org/project/behave-cucumber-matcher
# token: PYPI_API_TOKEN
# repository-url: https://upload.pypi.org/legacy/
environment:
name: ${{ matrix.environment.name }}
url: ${{ matrix.environment.url }}
permissions:
id-token: write
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: actions/checkout@v4
- name: Build package
run: make build
- name: Publish distribution 📦 to ${{ matrix.environment.name }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets[matrix.environment.token] }}
repository-url: ${{ matrix.environment.repository-url }}