Skip to content

Update requirements #84

Update requirements

Update requirements #84

Workflow file for this run

# 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