Skip to content

edgedb-python 1.3.1 #162

edgedb-python 1.3.1

edgedb-python 1.3.1 #162

Workflow file for this run

name: Release
on:
pull_request:
branches:
- "master"
- "ci"
- "[0-9]+.[0-9x]+*"
paths:
- "edgedb/_version.py"
jobs:
validate-release-request:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.checkver.outputs.version }}
steps:
- name: Validate release PR
uses: edgedb/action-release/validate-pr@master
id: checkver
with:
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
require_team: Release Managers
require_approval: no
version_file: edgedb/_version.py
version_line_pattern: |
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
- name: Stop if not approved
if: steps.checkver.outputs.approved != 'true'
run: |
echo ::error::PR is not approved yet.
exit 1
- name: Store release version for later use
env:
VERSION: ${{ steps.checkver.outputs.version }}
run: |
mkdir -p dist/
echo "${VERSION}" > dist/VERSION
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist/
build-sdist:
needs: validate-release-request
runs-on: ubuntu-latest
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 50
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
- name: Build source distribution
run: |
pip install -U setuptools wheel pip
python setup.py sdist
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*.tar.*
build-wheels:
needs: validate-release-request
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
cibw_python: ["cp37-*", "cp38-*", "cp39-*", "cp310-*"]
cibw_arch: ["auto64"]
defaults:
run:
shell: bash
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 50
submodules: true
- name: Setup WSL
if: ${{ steps.release.outputs.version == 0 && matrix.os == 'windows-2019' }}
uses: vampire/setup-wsl@v1
with:
wsl-shell-user: edgedb
additional-packages:
ca-certificates
curl
- name: Install EdgeDB
uses: edgedb/setup-edgedb@v1
with:
server-version: 3.0
- uses: pypa/[email protected]
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: ${{ matrix.cibw_python }}
# Cannot test on Musl distros yet.
CIBW_SKIP: "*-musllinux*"
CIBW_ARCHS: ${{ matrix.cibw_arch }}
# EdgeDB doesn't run on CentOS 6, so use 2014 as baseline
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
CIBW_BEFORE_ALL_LINUX: >
.github/workflows/install-edgedb.sh
CIBW_TEST_EXTRAS: "test"
CIBW_TEST_COMMAND: >
python {project}/tests/__init__.py
CIBW_TEST_COMMAND_WINDOWS: >
python {project}\tests\__init__.py
CIBW_TEST_COMMAND_LINUX: >
PY=`which python`
&& CODEGEN=`which edgedb-py`
&& chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))"
&& su -l edgedb -c "EDGEDB_PYTHON_TEST_CODEGEN_CMD=$CODEGEN $PY {project}/tests/__init__.py"
- uses: actions/upload-artifact@v2
with:
name: dist
path: wheelhouse/*.whl
publish:
needs: [build-sdist, build-wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
submodules: false
- uses: actions/download-artifact@v2
with:
name: dist
path: dist/
- name: Extract Release Version
id: relver
run: |
set -e
echo ::set-output name=version::$(cat dist/VERSION)
rm dist/VERSION
- name: Merge and tag the PR
uses: edgedb/action-release/merge@master
with:
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
ssh_key: ${{ secrets.RELEASE_BOT_SSH_KEY }}
gpg_key: ${{ secrets.RELEASE_BOT_GPG_KEY }}
gpg_key_id: "5C468778062D87BF!"
tag_name: v${{ steps.relver.outputs.version }}
- name: Publish Github Release
uses: elprans/gh-action-create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.relver.outputs.version }}
release_name: v${{ steps.relver.outputs.version }}
target: ${{ github.event.pull_request.base.ref }}
body: ${{ github.event.pull_request.body }}
draft: true
- run: |
ls -al dist/
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# password: ${{ secrets.TEST_PYPI_TOKEN }}
# repository_url: https://test.pypi.org/legacy/