-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.37 KB
/
build_and_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
46
47
name: Build and Publish
# Run this workflow every time a new commit pushed to your repository
on: push
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
catplist-build:
# Name the Job
name: Build catplist and publish
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v3
- name: Install build and test dependencies
run: python -m pip install --user --upgrade build setuptools wheel pytest pytest-cov click ruamel.yaml
- name: Run small tests
run: python -m pytest
- name: Build
run: python -m build
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Test install
run: python -m pip install --user --upgrade -i https://test.pypi.org/simple/ catplist
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}