Skip to content

Commit

Permalink
Merge 70f33d7 into f90fad0
Browse files Browse the repository at this point in the history
  • Loading branch information
arcivanov committed Oct 13, 2021
2 parents f90fad0 + 70f33d7 commit 289c67e
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 41 deletions.
72 changes: 72 additions & 0 deletions .github/action.yml
@@ -0,0 +1,72 @@
name: 'PyBuilder Action'
description: 'PyBuilder Internal Build Action'
inputs:
python-version:
description: 'Python version to use, if installing'
required: true
with-venv:
description: 'Whether to use Virtualenv during a build'
required: true
with-homebrew:
description: 'Whether to install Python with Homebrew'
required: true
deploy-on-os:
description: 'Deploy on OSes'
required: true
deploy-on-python:
description: 'Deploy on Pythons'
required: true
deploy-on-branch:
description: 'Deploy on Branches'
required: true
runs:
using: "composite"
steps:
- name: Configure
id: configure
uses: ChristopherHX/conditional@main
with:
if: |
${{ contains(fromJSON(inputs.deploy-on-os), runner.os) &&
contains(fromJSON(inputs.deploy-on-python), inputs.python-version) &&
contains(fromJSON(inputs.deploy-on-branch), github.ref) &&
inputs.with-venv == 'true' }}
step: |
shell: bash
run: |
echo "PYB_EXTRA_ARGS=+upload" >> $GITHUB_ENV
- name: Build
id: build
uses: ChristopherHX/conditional@main
with:
if: |
${{ !(inputs.with-homebrew == 'true' && runner.os != 'macOS' ||
inputs.with-homebrew == 'true' && runner.os == 'macOS' &&
(inputs.python-version == '3.6' ||
contains(inputs.python-version, '-rc') ||
contains(inputs.python-version, '-b') ||
contains(inputs.python-version, 'pypy-')
)
) }}
step: |
uses: pybuilder/build@master
with:
checkout: 'false'
python-version: '${{ inputs.python-version }}'
homebrew-python: '${{ inputs.with-homebrew }}'
with-venv: ${{ inputs.with-venv }}
install-pyb: 'false'
pyb-command: $PYTHON build.py
pyb-extra-args: +install ${{ env.PYB_EXTRA_ARGS }}
- name: Print Logs on Failure
uses: ChristopherHX/conditional@main
with:
if: ${{ steps.configure.output == 'failure' || steps.build.output == 'failure' }}
step: |
shell: bash
run: |
for f in $(find . -name \*.log); do
echo ">>>>>> $f"
cat "$f"
done
exit 1
84 changes: 43 additions & 41 deletions .github/workflows/pybuilder.yml
Expand Up @@ -5,14 +5,46 @@ on:
branches:
- master
jobs:
build-stable:
build-primary:
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
python-version:
- '3.10'
- '3.9'
- '3.8'
- '3.7'
- '3.6'
- 'pypy-3.7'
with-venv:
- 'true'
- 'false'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/
with:
python-version: ${{ matrix.python-version }}
with-venv: ${{ matrix.with-venv }}
homebrew-python: "false"
deploy-on-python: "['3.9']"
deploy-on-os: "['Linux']"
deploy-on-branch: "['refs/heads/master']"
build-secondary:
runs-on: ${{ matrix.os }}
continue-on-error: false
needs: build-primary
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- macos-10.15
- macos-11
Expand All @@ -30,55 +62,25 @@ jobs:
- 'true'
- 'false'
env:
DEPLOY_BRANCHES: "refs/heads/master"
DEPLOY_PYTHONS: "3.9"
DEPLOY_OSES: "Linux"
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- shell: bash
name: Configure
if: |
contains(env.DEPLOY_OSES, runner.os) &&
contains(env.DEPLOY_PYTHONS, matrix.python-version) &&
contains(env.DEPLOY_BRANCHES, github.ref) &&
matrix.with-venv == 'true'
run: |
echo "PYB_EXTRA_ARGS='+upload'" >> $GITHUB_ENV
- uses: pybuilder/build@master
name: Build
if: |
!(matrix.with-homebrew == 'true' && runner.os != 'macOS' ||
matrix.with-homebrew == 'true' && runner.os == 'macOS' &&
(matrix.python-version == '3.6' ||
contains(matrix.python-version, '-rc') ||
contains(matrix.python-version, '-b') ||
contains(matrix.python-version, 'pypy-')
)
)
- uses: actions/checkout@v2
- uses: ./.github/
with:
python-version: ${{ matrix.python-version }}
homebrew-python: ${{ matrix.with-homebrew }}
with-venv: ${{ matrix.with-venv }}
install-pyb: 'false'
pyb-command: $PYTHON build.py
pyb-extra-args: +install ${{ env.PYB_EXTRA_ARGS }}
- shell: bash
name: Print Logs on Failure
if: failure()
run: |
for f in $(find . -name \*.log); do
echo ">>>>>> $f"
cat "$f"
done
exit 1
homebrew-python: ${{ matrix.with-homebrew }}
deploy-on-python: "[]"
deploy-on-os: "[]"
deploy-on-branch: "[]"
build-stable-summary:
if: success() || failure()
runs-on: ubuntu-latest
name: Build Stable Summary
needs: build-stable
needs:
- build-primary
- build-secondary
steps:
- name: Check build matrix status
if: needs.build-stable.result != 'success'
if: needs.build-primary.result != 'success' || needs.build-secondary.result != 'success'
run: exit 1

0 comments on commit 289c67e

Please sign in to comment.