Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
115 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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