forked from PyPtt/PyPtt
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (51 loc) · 1.8 KB
/
deploy.yml
File metadata and controls
54 lines (51 loc) · 1.8 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: deploy
# run on merge to master or manual trigger
on:
pull_request:
types: [ closed ]
branches:
- master
paths:
- 'PyPtt/*.py'
- 'setup.py'
workflow_dispatch:
jobs:
deploy:
name: Deploy to PyPI and Docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Publish package to TestPyPI
if: github.event_name == 'workflow_dispatch' && github.event.pull_request.merged == false
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package
if: github.event_name != 'workflow_dispatch' && github.event.pull_request.merged == true
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Trigger Docker build
if: github.event_name != 'workflow_dispatch' && github.event.pull_request.merged == true
uses: InformaticsMatters/trigger-ci-action@1.0.1
with:
ci-owner: PyPtt
ci-repository: PyPtt_image
ci-user: PttCodingMan
ci-ref: refs/heads/main
ci-user-token: ${{ secrets.ACCESS_TOKEN }}
ci-name: build PyPtt image