-
Notifications
You must be signed in to change notification settings - Fork 48
49 lines (47 loc) · 1.4 KB
/
publish-staging-testpypi.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
40
41
42
43
44
45
46
47
48
49
name: Publish Python 🐍 distributions 📦 to TestPyPI
on:
push:
tags:
- 'v*.*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
name: Create Release from tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create Release
uses: softprops/action-gh-release@v2
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
draft: true
prerelease: false
deploy-testpypi:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
needs: release
environment: staging
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python3
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install packaging libraries
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build a binary wheel and a source tarball
run: |
python -m build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true