Release v0.15.2 #27
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: Upload Release Package to PyPI | |
on: | |
release: | |
types: [released] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Pulser | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Build packages | |
shell: bash | |
run: ./.github/scripts/package.sh | |
- name: Publish to TestPyPI | |
env: | |
TWINE_USERNAME: ${{ secrets.TESTPYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }} | |
run: twine upload --repository testpypi dist/* | |
- name: Install from TestPyPI | |
timeout-minutes: 5 | |
shell: bash | |
run: | | |
version="$(head -1 VERSION.txt)" | |
until pip install -i https://test.pypi.org/simple/ pulser==$version --extra-index-url https://pypi.org/simple | |
do | |
echo "Failed to install from TestPyPI, will wait for upload and retry." | |
sleep 30 | |
done | |
- name: Test the installation | |
# Installs pytest from dev_requirements.txt (in case it has a version specifier) | |
run: | | |
grep -e pytest dev_requirements.txt | sed 's/ //g' | xargs pip install | |
pytest | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: twine upload dist/* | |
- name: Confirm deployment | |
timeout-minutes: 5 | |
shell: bash | |
run: | | |
version="$(head -1 VERSION.txt)" | |
until pip download pulser==$version | |
do | |
echo "Failed to download from PyPI, will wait for upload and retry." | |
sleep 30 | |
done | |
check-release: | |
needs: deploy | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Check out Pulser | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Pulser from PyPI | |
timeout-minutes: 5 | |
shell: bash | |
run: | | |
python -m pip install --upgrade pip | |
version="$(head -1 VERSION.txt)" | |
until pip install pulser==$version | |
do | |
echo "Failed to install from PyPI, will wait for upload and retry." | |
sleep 30 | |
done | |
- name: Test the installation | |
shell: bash | |
run: | | |
version="$(head -1 VERSION.txt)" | |
python -c "import pulser; assert pulser.__version__ == '$version'" | |
grep -e pytest dev_requirements.txt | sed 's/ //g' | xargs pip install | |
pytest |