-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.43 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
46
47
48
49
50
51
name: cicd
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
max-parallel: 1
matrix:
python-version: [3.9]
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
rm -rf .env
python do.py setup
python do.py init
- name: Build distribution
run: |
python do.py dist
- name: Install package on clean env
run: |
rm -rf .env
python do.py setup
python do.py install
python do.py init
- name: Get package version
id: get_version
run: |
echo "::set-output name=version::v$(python do.py version)"
- name: Check tag for current version
uses: mukunku/[email protected]
id: check_tag
with:
tag: ${{ steps.get_version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package
if: github.ref == 'refs/heads/main' && steps.check_tag.outputs.exists == 'false'
run: |
PYPI_USERNAME=__token__ PYPI_PASSWORD=${{ secrets.PYPI_API_TOKEN }} python do.py release