Skip to content

Create LICENSE

Create LICENSE #16

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false # Continue even if one OS fails
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13.2'
# Install pyenv dependencies (Ubuntu only)
- name: Install pyenv dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev curl libncurses5-dev libncursesw5-dev \
xz-utils libffi-dev liblzma-dev python3-openssl
# Install dependencies
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
# Run tests (placeholder—uncomment and adjust when tests are added)
# - name: Run tests
# run: |
# pip install pytest
# pytest tests/
# Build the executable with PyInstaller
- name: Build executable
run: |
pyinstaller pagertree.spec
shell: bash # Use bash for consistent scripting across OSes
# Version the build (using git tag or commit SHA)
- name: Set version
id: version
run: |
VERSION=$(git describe --tags --always --dirty)
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: bash
# Upload artifact
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: pagertree-${{ matrix.os == 'ubuntu-latest' && 'linux' || 'windows' }}-${{ env.VERSION }}
path: dist/pagertree${{ matrix.os == 'windows-latest' && '.exe' || '' }}
# Publish to GitHub Releases (only on push to main)
- name: Create Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.VERSION }}
name: Release ${{ env.VERSION }}
draft: false
prerelease: false
files: |
dist/pagertree
dist/pagertree.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}