Skip to content

Release 6.15.16

Release 6.15.16 #126

Workflow file for this run

name: Build wheel
on:
release:
types: [created]
workflow_call:
inputs:
branch:
default: ${{ github.ref }}
required: true
type: string
workflow_dispatch:
jobs:
build_wheel:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.7']
exclude:
- os: macos-14 # macos-14 is apple silicon
python-version: '3.7'
- os: macos-14
python-version: '3.8'
- os: macos-14
python-version: '3.9'
name: Build [${{ matrix.os }}-${{ matrix.python-version }}]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
repository: marcelotduarte/cx_Freeze
- uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64,ppc64le
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install "`grep cibuildwheel requirements-dev.txt`"
- name: Build wheel for Python ${{ matrix.python-version }}
run: |
PY_VERSION_NODOT=$(echo ${{ matrix.python-version }}|sed 's/\.//')
if [ "${{ matrix.os }}" == "macos-13" ]; then
export CIBW_ARCHS="x86_64"
elif [ "${{ matrix.os }}" == "macos-14" ]; then
export CIBW_ARCHS="arm64"
fi
export CIBW_BUILD="cp${PY_VERSION_NODOT}-*"
python -m cibuildwheel --output-dir wheelhouse --prerelease-pythons
- name: Add sdist
if: runner.os == 'Linux' && matrix.python-version == '3.11'
run: |
python -m pip install --upgrade pip build
python -m build . --sdist -o wheelhouse
- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: cx-freeze-pip-${{ matrix.os }}-${{ matrix.python-version }}
path: wheelhouse
publish:
name: Publish package to PyPI
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
needs:
- build_wheel
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/cx-Freeze
permissions:
id-token: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Join files to upload
run: |
mkdir -p wheelhouse
mv artifacts/cx-freeze-pip-*/* wheelhouse/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse/
skip-existing: true
verbose: true
update_bases:
name: Update cx_Freeze/bases and util module
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
needs:
- build_wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
repository: marcelotduarte/cx_Freeze
token: ${{ secrets.PUSH }}
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: If changed, extract and update the base executables and util module
run: |
SHA256SUM1=$(cat source/*.c source/bases/* | sha256sum | awk '{print $1}')
SHA256SUM2=$(cat cx_Freeze/bases/__init__.py | awk '{print $2}')
if [ $SHA256SUM1 != $SHA256SUM2 ]; then
git config user.name "Marcelo Duarte"
git config user.email marcelotduarte@users.noreply.github.com
git checkout -B update_bases ${{ inputs.branch }}
# Remove any file that match - remove previous versions too
git rm --ignore-unmatch 'cx_Freeze/bases/*-win*.exe' 'cx_Freeze/util.*-win*.pyd'
# Extract base executables and util module
for file in artifacts/cx-freeze-pip-windows-*/*-win*.whl; do
unzip -o $file 'cx_Freeze/bases/*-win*.exe' 'cx_Freeze/util.*-win*.pyd'
done
git add cx_Freeze/bases/*-win*.exe cx_Freeze/util.*-win*.pyd
# Save the new SHA256SUM
echo "# $SHA256SUM1" > cx_Freeze/bases/__init__.py
git add cx_Freeze/bases/__init__.py
# Update
git commit -m "bases: update base executables and util module [ci skip]"
git push origin update_bases
fi