-
-
Notifications
You must be signed in to change notification settings - Fork 293
120 lines (100 loc) · 3.37 KB
/
release.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
113
114
115
116
117
118
119
120
name: Build and Publish
on:
push:
tags:
- "v*"
jobs:
validate:
if: github.repository == 'dipu-bd/lightnovel-crawler'
name: Lint & Test
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Check VERSION file
run: |
[ "${GITHUB_REF##*/}" == "v$(head -n 1 lncrawl/VERSION)" ] || exit 100
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip wheel setuptools
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
flake8 -v --count --show-source --statistics
- name: Build wheel
run: python setup.py clean bdist_wheel
- name: Install and test the wheel package
run: |
pip install dist/lightnovel_crawler*.whl
lncrawl --list-sources
lncrawl -s 'https://novelfull.com/the-kings-avatar-for-the-glory.html' --first 2 -f --format epub --suppress -lll
build-windows:
if: github.repository == 'dipu-bd/lightnovel-crawler'
needs: validate
name: Windows Build
runs-on: windows-latest
steps:
- name: Install OpenSSL
run: choco install -y --no-progress openssl
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build package
env:
PYTHONIOENCODING: utf-8
run: .\scripts\build.bat
- name: Test the executable package
env:
PYTHONIOENCODING: utf-8
run: .\dist\lncrawl.exe --list-sources
- name: Release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with: # See available options at https://github.com/ncipollo/release-action
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "dist/lncrawl*"
token: ${{ secrets.GITHUB_TOKEN }}
build-linux:
if: github.repository == 'dipu-bd/lightnovel-crawler'
needs: [validate, build-windows]
name: Linux Build & Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build package
run: sh ./scripts/build.sh
- name: Test the executable package
run: ./dist/lncrawl --list-sources
- name: Release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with: # See available options at https://github.com/ncipollo/release-action
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "dist/lncrawl,dist/*.whl"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update download links
env:
REBRANDLY_API_KEY: ${{ secrets.REBRANDLY_API_KEY }}
run: sh ./scripts/rebrandly.sh
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_NON_INTERACTIVE: true
run: sh ./scripts/publish.sh