build job #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |