Skip to content

add disk caching

add disk caching #46

Workflow file for this run

name: Build
on:
workflow_dispatch:
schedule:
- cron: "30 1 1,15 * *"
push:
tags:
- "v*.*.*"
paths:
- '.github/workflows/**'
- 'templates/**'
- 'main.py'
- 'data/**'
- 'helpers/**'
- 'config.ini'
- 'requirements.txt'
- 'images/logo.ico'
branches:
- main
defaults:
run:
shell: bash
jobs:
build:
name: Build release binaries
strategy:
fail-fast: false
matrix:
os:
- macos
- ubuntu
- windows
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip pyinstaller
pip install -r requirements.txt
- name: Build with pyinstaller
run: pyinstaller --icon=images/logo.ico --onefile --distpath dist/twitchcollabnetwork/${{ matrix.os }}-${{github.ref_name}}/ --collect-data pyvis --name=twitchcollabnetwork-${{github.ref_name}} main.py
- name: Copy Resources
run: mkdir dist/twitchcollabnetwork/${{ matrix.os }}-${{github.ref_name}}/templates && cp templates/* dist/twitchcollabnetwork/${{ matrix.os }}-${{github.ref_name}}/templates/
- name: Copy Config
run: cp config.ini dist/twitchcollabnetwork/${{ matrix.os }}-${{github.ref_name}}/config.ini
- name: Deploy Artifacts
uses: actions/upload-artifact@v4
if: true && !startsWith(github.ref, 'refs/tags/')
with:
name: twitchcollabnetwork-${{matrix.os}}-latest
path: dist/twitchcollabnetwork/${{matrix.os}}-${{github.ref_name}}/
if-no-files-found: error
retention-days: 20
- name: Release Rename
if: startsWith(github.ref, 'refs/tags/') && !startsWith(matrix.os, 'windows')
run: |
mkdir twitchcollabnetwork-${{github.ref_name}}
mv dist/twitchcollabnetwork/${{matrix.os}}-${{github.ref_name}}/* twitchcollabnetwork-${{github.ref_name}}/
zip -r twitchcollabnetwork-${{matrix.os}}-${{github.ref_name}}.zip twitchcollabnetwork-${{github.ref_name}}
- name: Release Rename - Windows
if: startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'windows')
run: |
mkdir twitchcollabnetwork-${{github.ref_name}}
mv dist/twitchcollabnetwork/${{matrix.os}}-${{github.ref_name}}/* twitchcollabnetwork-${{github.ref_name}}/
7z a twitchcollabnetwork-${{matrix.os}}-${{github.ref_name}}.zip twitchcollabnetwork-${{github.ref_name}}
- name: Release Artifacts
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.TCN_GITHUB_TOKEN }}
files: twitchcollabnetwork-${{matrix.os}}-${{github.ref_name}}.zip