mirror of
https://github.com/pypa/gh-action-pypi-publish.git
synced 2024-11-23 00:51:05 -05:00
✨ Pre-install Python if there's none
This is not usually the case for GitHub-hosted Runners but it might happen with self-hosted runners. Fixes #289.
This commit is contained in:
parent
0a87186d5f
commit
9b4dfb0c84
1 changed files with 17 additions and 1 deletions
18
action.yml
18
action.yml
|
@ -130,10 +130,26 @@ runs:
|
||||||
PR_REF: ${{ github.event.pull_request.head.ref }}
|
PR_REF: ${{ github.event.pull_request.head.ref }}
|
||||||
PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
|
PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
PR_REPO_ID: ${{ github.event.pull_request.base.repo.id }}
|
PR_REPO_ID: ${{ github.event.pull_request.base.repo.id }}
|
||||||
|
- name: Discover pre-installed Python
|
||||||
|
id: pre-installed-python
|
||||||
|
run: |
|
||||||
|
# 🔎 Discover pre-installed Python
|
||||||
|
echo "python-path=$(command -v python3 || :)" | tee -a "${GITHUB_OUTPUT}"
|
||||||
|
shell: bash
|
||||||
|
- name: Install Python 3
|
||||||
|
if: steps.pre-installed-python.outputs.python-path == ''
|
||||||
|
id: new-python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
- name: Create Docker container action
|
- name: Create Docker container action
|
||||||
run: |
|
run: |
|
||||||
# Create Docker container action
|
# Create Docker container action
|
||||||
python ${{ github.action_path }}/create-docker-action.py
|
${{
|
||||||
|
steps.pre-installed-python.outputs.python-path == ''
|
||||||
|
&& steps.new-python.outputs.python-path
|
||||||
|
|| steps.pre-installed-python.outputs.python-path
|
||||||
|
}} '${{ github.action_path }}/create-docker-action.py'
|
||||||
env:
|
env:
|
||||||
REF: ${{ steps.set-repo-and-ref.outputs.ref }}
|
REF: ${{ steps.set-repo-and-ref.outputs.ref }}
|
||||||
REPO: ${{ steps.set-repo-and-ref.outputs.repo }}
|
REPO: ${{ steps.set-repo-and-ref.outputs.repo }}
|
||||||
|
|
Loading…
Reference in a new issue