Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit 53438d1

Browse files
committed
Update workflow file
1 parent e41648e commit 53438d1

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- 'v*'
7+
workflow_dispatch:
78

89
jobs:
910
build_and_release:
@@ -15,9 +16,10 @@ jobs:
1516
artifact_name: ImpartusScraper.exe
1617
asset_name: impartus-scraper-windows.exe
1718

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
2123

2224
steps:
2325
- uses: actions/checkout@v2
@@ -30,7 +32,7 @@ jobs:
3032
python-version: 3.7
3133

3234
- name: Install Poetry
33-
uses: Gr1N/setup-poetry@v3
35+
uses: Gr1N/setup-poetry@v4
3436

3537
- name: Get poetry cache dir
3638
id: poetry-cache-dir
@@ -46,39 +48,48 @@ jobs:
4648
${{ runner.os }}-poetry-
4749
4850
- name: Install deps win
49-
if: runner.os == 'Windows'
51+
if: runner.os == 'Windows' && steps.poetry-cache.outputs.cache-hit != 'true'
5052
run: |
5153
# Download and extract FFmpeg, needs to be in PATH.
5254
# Copy it to poetry dir so that it can be cached
5355
# TODO: Compile ffmpeg manually to save space
5456
iwr https://github.com/ShareX/FFmpeg/releases/download/v4.3.1/ffmpeg-4.3.1-win64.zip -OutFile ffmpeg.zip
5557
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
5761

5862
- name: Install deps ubuntu
5963
if: runner.os == 'Linux'
6064
run: |
6165
# TODO: Compile ffmpeg manually to save space
6266
sudo apt update
6367
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
6569
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'
6872
run: |
6973
# 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
7580

7681
- name: Build file using pyinstaller
7782
run: poetry run pyinstaller build.spec
7883

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+
7990
- name: Upload to release
8091
if: startsWith(github.ref, 'refs/tags/v')
81-
uses: svenstaro/upload-release-action@v1-release
92+
uses: svenstaro/upload-release-action@v2
8293
with:
8394
repo_token: ${{ secrets.GITHUB_TOKEN }}
8495
file: dist/${{ matrix.artifact_name }}

0 commit comments

Comments
 (0)