~fabrixxm/climatik

1ccfebe3c2a10d5927c50fec8090a1892f4d6eed — fabrixxm 2 years ago 8c53cb4
Replace build.sh with Taskfile
2 files changed, 42 insertions(+), 36 deletions(-)

A Taskfile
D build.sh
A Taskfile => Taskfile +42 -0
@@ 0,0 1,42 @@
#!/usr/bin/env bash
# Taskfile - https://github.com/adriancooney/Taskfile

set -euo pipefail

function clean {
    rm -fr build dist *.egg-info
}

function test {
    nose2
    mypy -m climatik
}

function build {
    test
    python3 setup.py bdist_wheel
    twine check dist/*
}

function upload {
    build
    if [ "$1" == "--dist" ]
    then
        twine upload dist/*
    else
        twine upload --repository-url https://test.pypi.org/legacy/ dist/*
    fi
}

function help {
    echo "clean"
    echo "test"
    echo "build"
    echo "upload [--dist]"
}

function default {
    build
}

"${@:-default}"
\ No newline at end of file

D build.sh => build.sh +0 -36
@@ 1,36 0,0 @@
#!/bin/bash
#
# usage: 
#   build.sh [upload [--dist]]
#   build.sh clean
#
# upload : upload package to test pypi instance
# --dist   : upload package to real pypi instance
# clean : delete build files

# pacman -S twine python-wheel mypy

set -e


if [ "$1" == "clean" ]
then
    rm -fr build dist *.egg-info
    exit 0
fi

mypy -m climatik

python3 setup.py bdist_wheel

twine check dist/*

if [ "$1" == "upload" ]
then
    if [ "$2" == "--dist" ]
    then
        twine upload dist/*
    else
        twine upload --repository-url https://test.pypi.org/legacy/ dist/*
    fi
fi
\ No newline at end of file