-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (61 loc) · 1.68 KB
/
pypi-pub.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
52
53
54
55
56
57
58
59
60
61
62
63
64
name: "PYPI publish"
on:
push:
tags: ["v*"]
pull_request:
branches: [ dev, master ]
jobs:
build:
runs-on: "ubuntu-latest"
strategy:
matrix:
build_thing:
- lifeblood
- lifeblood_viewer
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
if [ -f requirements_tests.txt ]; then pip install -r requirements_tests.txt; fi
- name: build ${{ matrix.build_thing }}
run: |
cd pkg_${{ matrix.build_thing }}
VER=${{ github.ref_name }}
VER=${VER:1}
VER="1.2.3"
sed -i "s/version = 0.3.0/version = $VER/g" setup.cfg
./build_pypi.sh
- uses: actions/upload-artifact@master
with:
name: build_${{ matrix.build_thing }}
path: |
pkg_${{ matrix.build_thing }}/dist/*
publish:
runs-on: "ubuntu-latest"
needs: [ "build" ]
strategy:
matrix:
the_thing:
- lifeblood
- lifeblood_viewer
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: "install requirements"
run: |
python -m pip install --upgrade pip twine
- uses: actions/download-artifact@v4
with:
name: build_${{ matrix.the_thing }}
path: stuff
- name: "upload to pypi"
env:
TWINE_PASSWORD: ${{ secrets.pypi_key }}
run: |
echo would run python -m twine upload --repository testpypi -u __token__ stuff/*
ls -alhR .