This commit is contained in:
Dima Gerasimov 2020-04-26 16:54:34 +01:00 committed by karlicoss
parent 526e7d3fa9
commit 81ca1e2c25
3 changed files with 34 additions and 2 deletions

View file

@ -9,12 +9,13 @@ env:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [ubuntu-latest, macos-latest] # TODO windows-latest??
python-version: [3.6, 3.7, 3.8]
runs-on: ${{ matrix.platform }}
steps:
# fuck me. https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
- run: echo "::add-path::$HOME/.local/bin"

View file

@ -3,5 +3,22 @@
cd "$(dirname "$0")"
cd ../..
if ! command -v sudo; then
# CI or Docker sometimes doesn't have it, so useful to have a dummy
function sudo {
"$@"
}
fi
if ! [ -z "$CI" ]; then
# install OS specific stuff here
if [[ "$OSTYPE" == "darwin"* ]]; then
# macos
:
else
:
fi
fi
pip3 install --user tox
tox

View file

@ -1,4 +1,18 @@
#!/usr/bin/env python3
'''
Run [[file:scripts/release][scripts/release]] to deploy Python package onto [[https://pypi.org][PyPi]] and [[https://test.pypi.org][test PyPi]].
The script expects =TWINE_PASSWORD= environment variable to contain the [[https://pypi.org/help/#apitoken][PyPi token]] (not the password!).
The script can be run manually.
It's also running as =pypi= job in [[file:.github/workflows/main.yml][Github Actions config]]. Packages are deployed on:
- every master commit, onto test pypi
- every new tag, onto production pypi
You'll need to set =TWINE_PASSWORD= and =TWINE_PASSWORD_TEST= in [[https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets][secrets]]
for Github Actions deployment to work.
'''
import os
import sys
from pathlib import Path