~ferruck/yafg

yafg/.build.yml -rw-r--r-- 1.1 KiB
9b697db4 — Philipp Trommler Release v0.3 3 months ago
                                                                                
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
image: ubuntu/bionic

packages:
    - python
    - python-pip
    - python3
    - python3-pip

secrets:
    - d622464e-897f-41d3-ba3e-d646c2fea762

sources:
    - https://git.sr.ht/~ferruck/yafg

tasks:
    - setup: |
        pip3 install setuptools wheel twine virtualenv

    - tests: |
        # Access the virtualenv binary
        export PATH=$PATH:~/.local/bin

        # Begin tests
        cd yafg

        virtualenv -p python2 venv
        . venv/bin/activate
        pip install -r requirements.txt
        python -m unittest discover
        deactivate
        rm -rf venv

        virtualenv -p python3 venv
        . venv/bin/activate
        pip install -r requirements.txt
        python -m unittest discover
        deactivate
        rm -rf venv

    - deploy: |
        cd yafg
        if [ "$(git tag --points-at HEAD)" == "$(grep version setup.py | sed 's/.*\"\(.*\)\",/v\1/')" ]; then
            python3 setup.py sdist bdist_wheel --universal
            python3 -m twine upload --config-file ~/.pypirc dist/*
        fi

triggers:
    - action: email
      condition: failure
      to: "Philipp Trommler <yafg@philipp-trommler.me>"