-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (43 loc) · 1.24 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
40
41
42
43
44
45
name: Publish to PyPI
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
publish:
name: Publish ${{ matrix.package }}
runs-on: ubuntu-latest
strategy:
matrix:
package: [docker-run-cli, docker-run-docker-ros]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: python3 -m pip install --user build
- name: Build wheel and tarball
run: python3 -m build --sdist --wheel --outdir dist/ ${{ matrix.package }}
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.8.6
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.8.6
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
# `continue-on-error` needed cause `skip-existing: true` is not honored
# https://github.com/pypa/gh-action-pypi-publish/issues/201
continue-on-error: true