-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (104 loc) · 4.39 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
121
name: Create Release
on:
workflow_dispatch:
push:
tags:
- 'v*'
branches:
- main
env:
RELEASE_TAG: "0.1.0"
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
build_name: "scrapegoat_linux"
install_extra: sudo apt-get install -y python3-tk
build_cmd: pipenv run pyinstaller main.spec
chrome_filename: "chrome-linux64.zip"
chromedriver_filename: "chromedriver-linux64.zip"
chrome_url: "https://storage.googleapis.com/chrome-for-testing-public/131.0.6724.0/linux64/chrome-linux64.zip"
chromedriver_url: "https://storage.googleapis.com/chrome-for-testing-public/131.0.6724.0/linux64/chromedriver-linux64.zip"
release_file: /home/runner/work/scrapegoat/scrapegoat/build/main/scrapegoat_linux
- os: windows-latest
build_name: "scrapegoat_windows_x64.exe"
build_cmd: pipenv run pyinstaller main.spec
chrome_filename: "chrome-win64.zip"
chromedriver_filename: "chromedriver-win64.zip"
chrome_url: "https://storage.googleapis.com/chrome-for-testing-public/131.0.6724.0/win64/chrome-win64.zip"
chromedriver_url: "https://storage.googleapis.com/chrome-for-testing-public/131.0.6724.0/win64/chromedriver-win64.zip"
release_file: "D:\\a\\scrapegoat\\scrapegoat\\build\\main\\scrapegoat_windows_x64.exe"
# - os: macos-latest
# build_name: "scrapegoat_macos_x64"
# build_cmd: pipenv run pyinstaller main.spec
# chrome_filename: "chrome-mac-x64.zip"
# chromedriver_filename: "chromedriver-mac-x64.zip"
# chrome_url: "https://storage.googleapis.com/chrome-for-testing-public/131.0.6724.0/mac-x64/chrome-mac-x64.zip"
# chromedriver_url: "https://storage.googleapis.com/chrome-for-testing-public/131.0.6724.0/mac-x64/chromedriver-mac-x64.zip"
# release_file: /Users/runner/work/scrapegoat/scrapegoat/dist/scrapegoat_macos_x64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pipenv"
- name: Run image
uses: tiagovrtr/actions-pipenv@v1
with:
pipenv-version: "v2022.9.8"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pipenv wheel
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
- name: Install additional dependencies (if any)
run: ${{ matrix.install_extra || 'echo "No extra dependencies"' }}
- id: cache-pipenv
uses: actions/cache@v4
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install pipenv dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
- name: Install pefile (Windows)
if: matrix.os == 'windows-latest'
run: pipenv run pip install pefile
- name: Cache Chrome Portable
id: cache-chrome
uses: actions/cache@v4
with:
path: chrome_portable/**
key: chrome-${{ runner.os }}-${{ hashFiles(matrix.chrome_url) }}
- name: Download Chrome Portable
if: steps.cache-chrome.outputs.cache-hit != 'true'
run: |
curl -L ${{ matrix.chrome_url }} -o chrome_portable.zip
unzip chrome_portable.zip -d chrome_portable
- name: Cache ChromeDriver
id: cache-chromedriver
uses: actions/cache@v4
with:
path: chromedriver/**
key: chromedriver-${{ runner.os }}-${{ hashFiles(matrix.chromedriver_url) }}
- name: Download ChromeDriver
if: steps.cache-chromedriver.outputs.cache-hit != 'true'
run: |
curl -L ${{ matrix.chromedriver_url }} -o chromedriver.zip
unzip chromedriver.zip -d chromedriver
- name: Build executable
run: ${{ matrix.build_cmd }}
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE_TAG }}
token: ${{ secrets.RELEASE_TOKEN }}
files: ${{ matrix.release_file }}