Skip to content

Add support to publish cfr as a binary using PyInstaller #7

Add support to publish cfr as a binary using PyInstaller

Add support to publish cfr as a binary using PyInstaller #7

Workflow file for this run

# Stage PyInstaller application packages through GitHub Actions (GHA) to GitHub Workflow Artifacts section.
# https://github.com/actions/upload-artifact#where-does-the-upload-go
name: "Release: Application Bundle"
on:
pull_request: ~
push:
tags:
- '*.*.*'
jobs:
cfr:
name: "CFR for OS ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
"macos-13", # Intel
"macos-latest", # ARM
"ubuntu-latest", # Intel
"windows-latest", # Intel
]
steps:
- name: Compute build tag (OS-ARCH)
id: build-tag
shell: bash
run: |
# RUNNER_OS: Possible values are Linux, Windows, or macOS. For example, Windows
# RUNNER_ARCH: Possible values are X86, X64, ARM, or ARM64.
TAG="${RUNNER_OS@L}-${RUNNER_ARCH@L}"
echo "value=${TAG}" >> $GITHUB_OUTPUT
echo "Build Tag: ${TAG}"
- name: Acquire sources
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Set up project
run: |
# `setuptools 0.64.0` adds support for editable install hooks (PEP 660).
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
pip install "setuptools>=64" --upgrade
# Install dependencies needed to bundle the application.
pip install --use-pep517 --prefer-binary --editable='.[cfr,release-cfr]'
- name: Build application
run: poe build-cfr
- name: "Upload artifact for ${{ steps.build-tag.outputs.value }}"
if: runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: "cratedb-cfr-${{ steps.build-tag.outputs.value }}"
path: dist/cratedb-cfr
- name: "Upload artifact for ${{ steps.build-tag.outputs.value }}"
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: "cratedb-cfr-${{ steps.build-tag.outputs.value }}"
path: dist/cratedb-cfr.exe
# TODO: Optionally upload to release assets, when invoked on "tag" event.
#if: startsWith(github.event.ref, 'refs/tags')