Skip to content

Fix for nightly build virus detection (#5) #5

Fix for nightly build virus detection (#5)

Fix for nightly build virus detection (#5) #5

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
paths:
- '.github/workflows/**'
- 'templates/**'
- 'src/**'
- 'requirements.txt'
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.12'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip pyinstaller
pip install -r requirements.txt
- name: Release Versioning
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "__version__='${{github.ref_name}}'" > src/_version.py
- name: Nightly Versioning
if: true && !startsWith(github.ref, 'refs/tags/')
run: |
echo "__version__='nightly-${{github.sha}}'" > src/_version.py
- name: Build with pyinstaller
if: true && !startsWith(github.ref, 'refs/tags/')
run: pyinstaller --icon=images/logo.ico --onefile --add-data "images;images" --add-data "src/server/static;server/static" --distpath dist/twitchchatdnd/${{ matrix.os }}-${{github.ref_name}}/ --name=twitchchatdnd-nightly src/main.py
- name: Release Build with pyinstaller
if: startsWith(github.ref, 'refs/tags/')
run: pyinstaller --icon=images/logo.ico --onefile --add-data "images;images" --add-data "src/server/static;server/static" --distpath dist/twitchchatdnd/${{ matrix.os }}-${{github.ref_name}}/ --name=twitchchatdnd src/main.py
- name: Deploy Artifacts
uses: actions/upload-artifact@v4
if: true && !startsWith(github.ref, 'refs/tags/')
with:
name: twitchchatdnd-${{matrix.os}}-latest
path: dist/twitchchatdnd/${{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 twitchchatdnd-${{github.ref_name}}
mv dist/twitchchatdnd/${{matrix.os}}-${{github.ref_name}}/* twitchchatdnd-${{github.ref_name}}/
zip -r twitchchatdnd-${{matrix.os}}-${{github.ref_name}}.zip twitchchatdnd-${{github.ref_name}}
- name: Release Rename - Windows
if: startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'windows')
run: |
mkdir twitchchatdnd-${{github.ref_name}}
mv dist/twitchchatdnd/${{matrix.os}}-${{github.ref_name}}/* twitchchatdnd-${{github.ref_name}}/
7z a twitchchatdnd-${{matrix.os}}-${{github.ref_name}}.zip twitchchatdnd-${{github.ref_name}}
- name: Release Artifacts
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.TCDND_GITHUB_TOKEN }}
files: twitchchatdnd-${{matrix.os}}-${{github.ref_name}}.zip
- name: Nightly Release Rename
if: true && !startsWith(github.ref, 'refs/tags/') && !startsWith(matrix.os, 'windows')
run: |
mkdir twitchchatdnd-${{github.ref_name}}
mv dist/twitchchatdnd/${{matrix.os}}-${{github.ref_name}}/* twitchchatdnd-${{github.ref_name}}/
zip -r twitchchatdnd-${{matrix.os}}-${{github.ref_name}}.zip twitchchatdnd-${{github.ref_name}}
- name: Nightly Rename - Windows
if: true && !startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'windows')
run: |
mkdir twitchchatdnd-${{github.ref_name}}
mv dist/twitchchatdnd/${{matrix.os}}-${{github.ref_name}}/* twitchchatdnd-${{github.ref_name}}/
7z a twitchchatdnd-${{matrix.os}}-${{github.ref_name}}.zip twitchchatdnd-${{github.ref_name}}
- name: Release nightly
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.TCDND_GITHUB_TOKEN }}
prerelease: true
name: nightly
tag_name: nightly
files: twitchchatdnd-${{matrix.os}}-${{github.ref_name}}.zip
fail_on_unmatched_files: true