diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 76ee8cf..d7fac02 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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" diff --git a/scripts/ci/run b/scripts/ci/run index c49e635..48019d6 100755 --- a/scripts/ci/run +++ b/scripts/ci/run @@ -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 diff --git a/scripts/release b/scripts/release index c744b56..0ec687f 100755 --- a/scripts/release +++ b/scripts/release @@ -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