Release 6.15.9 #113
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [macos-latest, ubuntu-latest, windows-latest] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
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@v4 | |
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 "`grep cibuildwheel requirements-dev.txt`" | |
- name: Build wheel for Python ${{ matrix.python-version }} | |
run: | | |
pyver=$(python -c "print('${{ matrix.python-version }}'.partition('-')[0].replace('.',''))") | |
export CIBW_BUILD="cp${pyver}*" | |
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@v3 | |
with: | |
name: cx-freeze-wheelhouse | |
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: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.branch }} | |
repository: marcelotduarte/cx_Freeze | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
cache: 'pip' | |
python-version: "3.11" | |
- name: Download the artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: cx-freeze-wheelhouse | |
path: 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: ${{ inputs.branch }} | |
repository: marcelotduarte/cx_Freeze | |
token: ${{ secrets.PUSH }} | |
- name: Download the artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: cx-freeze-wheelhouse | |
path: wheelhouse | |
- 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 | |
# 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 wheelhouse/*-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 --set-upstream origin ${{ inputs.branch }} | |
fi |