Skip to content

Merge pull request #5 from Dimensional/develop #12

Merge pull request #5 from Dimensional/develop

Merge pull request #5 from Dimensional/develop #12

Workflow file for this run

name: Build Windows EXEs
on:
push:
branches:
- develop
pull_request:
workflow_dispatch:
jobs:
test:
name: Test (unittest + pytest)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
working-directory: python
run: |
python -m pip install --upgrade pip
pip install -r requirements-build.txt
pip install pytest
- name: Run unit tests
working-directory: python
run: python -m unittest discover -s tests -v
- name: Run pytest
working-directory: python
run: pytest tests/ -v
build-windows-x64:
name: Build (windows-x64)
needs: test
runs-on: windows-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install build dependencies
working-directory: python
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
- name: Run parity smoke test
working-directory: python
run: |
python -m unittest tests.test_fca_unittest.TestFCAToolParity.test_tool_encode_decode_matches_standalone -v
- name: Ensure icon file exists
working-directory: python
run: |
if (!(Test-Path small-logo.ico)) {
python build_icon.py --input-file small-logo.png --output-file small-logo.ico
}
- name: Build executables
working-directory: python
run: |
python -m PyInstaller --clean --noconfirm --onefile --icon small-logo.ico --name fca-encode --distpath ../dist/windows-x64 fca_encode.py
python -m PyInstaller --clean --noconfirm --onefile --icon small-logo.ico --name fca-decode --distpath ../dist/windows-x64 fca_decode.py
python -m PyInstaller --clean --noconfirm --onefile --icon small-logo.ico --name fca-tool --distpath ../dist/windows-x64 fca_tool.py
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: fca-exes-windows-x64
path: dist/windows-x64
if-no-files-found: error
release:
name: Publish Rolling Release
if: github.ref == 'refs/heads/develop'
needs: build-windows-x64
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download windows-x64 artifacts
uses: actions/download-artifact@v4
with:
name: fca-exes-windows-x64
path: dist/windows-x64
- name: Remove existing rolling assets
shell: bash
run: |
if gh release view rolling --json assets -q '.assets[].name' > /tmp/rolling_assets.txt; then
cat /tmp/rolling_assets.txt | xargs -r -I {} gh release delete-asset rolling "{}" -y
else
echo "Rolling release not found yet; skipping asset cleanup."
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
- name: Create or update rolling release and upload assets
uses: softprops/action-gh-release@v2
with:
tag_name: rolling
name: Rolling Release
target_commitish: ${{ github.sha }}
body: |
Build from ${{ github.sha }}
${{ github.event.head_commit.message }}
files: dist/windows-x64/*
generate_release_notes: false
overwrite_files: true
prerelease: true
make_latest: true
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}