Skip to content

Extend pandas compatibility window to include pandas-2.2 (#7845) #904

Extend pandas compatibility window to include pandas-2.2 (#7845)

Extend pandas compatibility window to include pandas-2.2 (#7845) #904

Workflow file for this run

name: Pre-release cirq to PyPi
on:
push:
branches:
- main
# Declare default permissions as read only.
permissions: read-all
jobs:
push_to_pypi:
if: github.repository == 'quantumlib/Cirq'
name: Push to PyPi
runs-on: ubuntu-22.04
env:
NAME: dev-release
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 2
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.11'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine
- name: Create PYPI config file
env:
CIRQ_PYPI_TOKEN: ${{ secrets.CIRQ_PYPI_TOKEN }}
CIRQ_TEST_PYPI_TOKEN: ${{ secrets.CIRQ_TEST_PYPI_TOKEN }}
run: |
envsubst < dev_tools/packaging/pypirc_template > $HOME/.pypirc
- name: Build and publish
run: |
CIRQ_PRE_RELEASE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh)
if [[ "${CIRQ_PRE_RELEASE_VERSION}" != *.dev* ]]; then
echo "Not a dev version"
exit 1
fi
echo "Building wheels for the dev version '${CIRQ_PRE_RELEASE_VERSION}'"
THIS_DATE_EPOCH=$(git log -1 --pretty="%ct")
out_dir="${HOME}/cirq-dist"
out_dir_last="${HOME}/cirq-dist-last"
dev_tools/packaging/produce-package.sh "${out_dir}" "${CIRQ_PRE_RELEASE_VERSION}"
# disregard errors from building wheels at the previous commit
SOURCE_DATE_EPOCH=${THIS_DATE_EPOCH} dev_tools/packaging/produce-package.sh \
--commit="HEAD~1" "${out_dir_last}" "${CIRQ_PRE_RELEASE_VERSION}" || true
echo "Comparing wheels with the build at previous commit"
if diff -q -r "${out_dir_last}" "${out_dir}"; then
echo "Wheels are identical - skipping the release"
echo "### Skipped identical release" >> ${GITHUB_STEP_SUMMARY}
echo "Cirq wheels for ${CIRQ_PRE_RELEASE_VERSION} (${GITHUB_SHA})" \
"are identical to their build at the previous commit." >> ${GITHUB_STEP_SUMMARY}
exit 0
fi
echo "Deploying dev version '$CIRQ_PRE_RELEASE_VERSION'"
twine upload "${out_dir}/*"