Skip to content

Commit

Permalink
add check-py-version action
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Jul 23, 2023
1 parent 0c5fa05 commit a1497e0
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,43 @@ jobs:
path: dist/*.tar.gz
if-no-files-found: error

etc:
check-py-version:
name: validate whether the python version was correctly set for this release
# NB: we define a "release" as a tag starting with a 'v'!
# if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- run: echo ${{ github.ref }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: pip install --upgrade pip

- run: python -c 'import tomllib; t = tomllib.load(open("pyproject.toml", "rb")); print("\n".join(t["build-system"]["requires"]));' > build-requires.txt

- run: pip install -r buidl-requires.txt

- run: "[[ \"refs/tags/v$(python setup.py --dry-run --version)\" == '${{ github.ref }}' ]]"

# check-rust-version:
# name: validate whether the python version was correctly set for this release
# # NB: we define a "release" as a tag starting with a 'v'!
# if: startsWith(github.ref, 'refs/tags/v')
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - run: pip install --upgrade pip
# - run: python setup.py --version > version.txt
# - run: [[ "refs/tags/v$(python setup.py --version)" == '${{ github.ref }}' ]]

build-bdists:
name: build bdists for many pythons in a row on ${{ matrix.os }}
# run on push to main, on release, and on PRs with the label 'Full Build'
if: "success() && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build'))"
# run on releases, and on PRs with the label 'Full Build'
if: "success() && (startsWith(github.ref, 'refs/tags/') || contains(github.event.pull_request.labels.*.name, 'Full Build'))"
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit a1497e0

Please sign in to comment.