-
Notifications
You must be signed in to change notification settings - Fork 76
112 lines (110 loc) · 4.03 KB
/
main.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on:
pull_request:
branches: [master]
push:
branches: [master]
tags: ["v*.*.*"]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install virtualenv wheel
virtualenv venv
./venv/Scripts/activate
python -m pip install -r windows/requirements.txt
python -m pip install pyinstaller
python -m pip install .
- name: Build
run: |
./venv/Scripts/activate
pyinstaller.exe windows/pywebdriver.spec
- name: Test build
shell: bash
run: |
timeout 3s ./dist/pywebdriver/pywebdriver.exe debug || test "$?" = 124
- name: prepare release
run: |
iscc.exe windows/setup.iss
move windows/Output/pywebdriver_win64_installer.exe .
7z a pywebdriver_win64.zip dist/pywebdriver
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
pywebdriver_win64.zip
pywebdriver_win64_installer.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-focal:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
sudo add-apt-repository ppa:jyrki-pulliainen/dh-virtualenv
sudo apt --yes update
sudo apt --yes install libnss3-tools libcups2-dev cups devscripts debhelper dh-python dh-virtualenv dh-systemd python3-wheel python3-setuptools python3-venv libmtp-dev libffi-dev fakeroot python3-distutils python3-pip python3-simplejson python3-flask-babel python3-usb python3-serial python3-netifaces python3-cups python3-pillow python3-flask-cors
- name: Build
run: |
mkdir -p build
dch --package pywebdriver --newversion $(date +%Y%m%d) --create -m "Created by CI"
debuild
- name: Test build
run: |
mv ../pywebdriver_$(date +%Y%m%d)_amd64.deb ../pywebdriver_focal.deb
sudo dpkg -i ../pywebdriver_focal.deb
sh debian/replace_snakeoil_mkcert.sh
sudo journalctl -u pywebdriver
sudo service pywebdriver status
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
../pywebdriver_focal.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-jammy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
sudo apt --yes update
sudo apt --yes install libnss3-tools libcups2-dev cups devscripts debhelper dh-python dh-virtualenv python3-wheel python3-setuptools python3-venv libmtp-dev libffi-dev fakeroot python3-distutils python3-pip python3-simplejson python3-flask-babel python3-usb python3-serial python3-netifaces python3-cups python3-pillow python3-flask-cors
- name: Build
run: |
mkdir -p build
dch --package pywebdriver --newversion $(date +%Y%m%d) --create -m "Created by CI"
debuild
- name: Test build
run: |
mv ../pywebdriver_$(date +%Y%m%d)_amd64.deb ../pywebdriver_jammy.deb
sudo dpkg -i ../pywebdriver_jammy.deb
sh debian/replace_snakeoil_mkcert.sh
sudo journalctl -u pywebdriver
sudo service pywebdriver status
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
../pywebdriver_jammy.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}