4
4
push :
5
5
tags :
6
6
- ' v*'
7
+ workflow_dispatch :
7
8
8
9
jobs :
9
10
build_and_release :
15
16
artifact_name : ImpartusScraper.exe
16
17
asset_name : impartus-scraper-windows.exe
17
18
18
- - os : ubuntu-18.04
19
- artifact_name : ImpartusScraper
20
- asset_name : impartus-scraper-linux
19
+ # disabled because it's very finicky
20
+ # - os: ubuntu-18.04
21
+ # artifact_name: ImpartusScraper
22
+ # asset_name: impartus-scraper-linux
21
23
22
24
steps :
23
25
- uses : actions/checkout@v2
30
32
python-version : 3.7
31
33
32
34
- name : Install Poetry
33
- uses : Gr1N/setup-poetry@v3
35
+ uses : Gr1N/setup-poetry@v4
34
36
35
37
- name : Get poetry cache dir
36
38
id : poetry-cache-dir
@@ -46,39 +48,48 @@ jobs:
46
48
${{ runner.os }}-poetry-
47
49
48
50
- name : Install deps win
49
- if : runner.os == 'Windows'
51
+ if : runner.os == 'Windows' && steps.poetry-cache.outputs.cache-hit != 'true'
50
52
run : |
51
53
# Download and extract FFmpeg, needs to be in PATH.
52
54
# Copy it to poetry dir so that it can be cached
53
55
# TODO: Compile ffmpeg manually to save space
54
56
iwr https://github.com/ShareX/FFmpeg/releases/download/v4.3.1/ffmpeg-4.3.1-win64.zip -OutFile ffmpeg.zip
55
57
Expand-Archive ffmpeg.zip -DestinationPath ${{ steps.poetry-cache-dir.outputs.dir }}
56
- echo "::add-path::${{ steps.poetry-cache-dir.outputs.dir }}"
58
+
59
+ - if : runner.os == 'Windows'
60
+ run : echo ${{ steps.poetry-cache-dir.outputs.dir }} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
57
61
58
62
- name : Install deps ubuntu
59
63
if : runner.os == 'Linux'
60
64
run : |
61
65
# TODO: Compile ffmpeg manually to save space
62
66
sudo apt update
63
67
sudo apt install -y ffmpeg pkg-config upx libgtk-3-dev
64
- echo "::set-env name= ILC_SCRAPER_UPX::1"
68
+ echo "ILC_SCRAPER_UPX=1" >> $GITHUB_ENV
65
69
66
- - name : Setup virtualenv
67
- if : steps.poetry-cache.outputs.cache-hit != 'true'
70
+ - name : Pre setup venv
71
+ if : runner.os == 'Linux' && steps.poetry-cache.outputs.cache-hit != 'true'
68
72
run : |
69
73
# manually add wxpython wheel
70
- if [[ $RUNNER_OS == "Linux" ]]; then
71
- wx_ver=$(poetry show wxpython | awk '/^version/ {print $3}');
72
- poetry run pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }} "wxPython==$wx_ver";
73
- fi
74
- poetry install -E gui
74
+ wx_ver=$(poetry show wxpython | awk '/^version/ {print $3}');
75
+ poetry run pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }} "wxPython==$wx_ver";
76
+
77
+ - name : Install python deps
78
+ if : steps.poetry-cache.outputs.cache-hit != 'true'
79
+ run : poetry install -E gui
75
80
76
81
- name : Build file using pyinstaller
77
82
run : poetry run pyinstaller build.spec
78
83
84
+ - name : Upload to artifact
85
+ uses : actions/upload-artifact@v2
86
+ with :
87
+ name : ${{ matrix.asset_name }}
88
+ path : dist/${{ matrix.artifact_name }}
89
+
79
90
- name : Upload to release
80
91
if : startsWith(github.ref, 'refs/tags/v')
81
- uses : svenstaro/upload-release-action@v1-release
92
+ uses : svenstaro/upload-release-action@v2
82
93
with :
83
94
repo_token : ${{ secrets.GITHUB_TOKEN }}
84
95
file : dist/${{ matrix.artifact_name }}
0 commit comments