-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (98 loc) · 3.56 KB
/
package.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on: [push, pull_request]
jobs:
Windows-Build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [3.10.7]
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: |
~\AppData\Local\pip\Cache
~\AppData\Local\Nuitka\Nuitka
kaist-safety-course-bot.build
kaist-safety-course-bot.dist
kaist-safety-course-bot-build
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-cache-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-cache-
- 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 --upgrade pip wheel
python -m pip install nuitka pytest zstandard -r requirements.txt
- name: Make OneFile
run: |
nuitka --assume-yes-for-downloads --show-scons --disable-console --plugin-enable=tk-inter --include-package-data=selenium --windows-icon-from-ico=assets/logo.ico --onefile -o kaist-safety-course-bot.exe run.py
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Windows-Binary
path: kaist-safety-course-bot.exe
MacOS-Build:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: [3.10.7]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements-mac.txt', 'requirements-dev.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install pytest -r requirements.txt -r requirements-mac.txt -r requirements-dev.txt
- name: Make OneFile
run: |
pyinstaller --onefile run.py
chmod +x dist/run
- name: Tar file
run: tar -cvf dist/kaist-safety-course-bot.tar dist/run
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Mac-Binary
path: dist/kaist-safety-course-bot.tar
publish:
name: Release
permissions:
contents: write
needs: [Windows-Build, MacOS-Build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download archived package
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Rename file name for release
run: |
mv artifacts/Windows-Binary/kaist-safety-course-bot.exe artifacts/kaist-safety-course-bot.exe
mv artifacts/Mac-Binary/kaist-safety-course-bot.tar artifacts/kaist-safety-course-bot.tar
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
body: "Released via Github Actions"
files: |
artifacts/kaist-safety-course-bot.exe
artifacts/kaist-safety-course-bot.tar