Skip to content
Open
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
66 changes: 66 additions & 0 deletions .github/workflows/release.yml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fajnie - moim zdaniem spore ułatwienie (szczególnie z brakującą wersją na macOS, którą np. ja bym budował na forku).
Jedyne co to do komendy pyinstallera trzeba dorzucić --add-data="fonts/*:fonts", bo inaczej przy zapisie ostemplowanego PDFa apka się wywali.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
build:
name: Build packages
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
TARGET: macos
CMD_BUILD: >
pyinstaller -F -w -n metryczka metryczka.py &&
cd dist/ &&
zip -r9 metryczka metryczka.app/
OUT_FILE_NAME: metryczka.zip
ASSET_MIME: application/zip

- os: windows-latest
TARGET: windows
CMD_BUILD: pyinstaller -F -w -n metryczka metryczka.py
OUT_FILE_NAME: metryczka.exe
ASSET_MIME: application/vnd.microsoft.portable-executable

- os: ubuntu-latest
TARGET: linux
CMD_BUILD: >
pyinstaller -F -w -n metryczka metryczka.py &&
cd dist/ &&
tar -czvf metryczka.tar.gz metryczka
OUT_FILE_NAME: metryczka.tar.gz
ASSET_MIME: application/gzip

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -r requirements.txt

- name: Build with pyinstaller for ${{ matrix.TARGET }}
run: ${{ matrix.CMD_BUILD }}

- name: Upload binaries to release
uses: softprops/action-gh-release@v2
with:
files: ./dist/${{ matrix.OUT_FILE_NAME }}
name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}