Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build executables

on:
push:
tags:
- "v*"
workflow_dispatch:

jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
suffix: linux
ext: ""
- os: windows-latest
suffix: windows
ext: ".exe"
- os: macos-latest
suffix: macos
ext: ""
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: pip install . pyinstaller

- name: Build executable
run: pyinstaller --onefile --name waybackup --additional-hooks-dir=hooks pywaybackup/main.py

- name: Rename artifact
shell: bash
run: mv "dist/waybackup${{ matrix.ext }}" "dist/waybackup-${{ matrix.suffix }}${{ matrix.ext }}"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: waybackup-${{ matrix.suffix }}
path: dist/waybackup-${{ matrix.suffix }}${{ matrix.ext }}

release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*
generate_release_notes: true
4 changes: 4 additions & 0 deletions hooks/hook-magic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs

datas = collect_data_files("magic")
binaries = collect_dynamic_libs("magic")