This repository has been archived by the owner on May 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 270
83 lines (69 loc) · 1.92 KB
/
CI.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: ci
on:
push:
branches:
- master
paths:
- src/client/**
tags-ignore:
- v*
pull_request:
types:
- opened
- synchronize
jobs:
build-windows:
runs-on: windows-2019
name: build windows binary
steps:
- uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: CI
shell: cmd
env:
PYTHONIOENCODING: utf-8
run: |
cd .\src\client
echo ::group::Install Dependencies
pip install wheel
pip install pyinstaller -r requirements.txt
echo ::endgroup::
echo ::group::Run Test
sed -e "s/\"\[v.*semver$/\"[test-${{ github.sha }}]\"/" -i.bak yobot.py
python main_test.py
echo ::endgroup::
echo ::group::Build Binary
pyinstaller main.spec
echo ::endgroup::
- name: Upload Artifact
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v2
with:
name: windows-executable
path: ./src/client/dist/yobot.exe
# upload:
# runs-on: ubuntu-20.04
# if: ${{ github.event_name != 'pull_request' }}
# needs: build-windows
# name: upload binary
# steps:
# - name: Download Artifact
# uses: actions/download-artifact@v2
# with:
# name: windows-executable
# - name: Initial rclone configuration
# run: echo "$RCLONE_CONF">rclone.conf
# env:
# RCLONE_CONF: ${{ secrets.RCLONE_CONF }}
# - name: Upload
# uses: docker://rclone/rclone:1
# with:
# args: --config rclone.conf copy yobot.exe remote:${{ github.run_number }}/