Skip to content

python

python #372

Workflow file for this run

name: python
on:
schedule:
- cron: "47 3 * * *"
push:
branches:
- main
paths:
- .github/workflows/python.yml
workflow_dispatch:
concurrency:
group: python
jobs:
fetch:
name: Fetch
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uniget
uses: uniget-org/uniget-action@main
with:
prefix: helper
tools: gojq
- name: Fetch
id: fetch
env:
# renovate: datasource=github-releases depName=indygreg/python-build-standalone versioning=loose
INDYGREG_PYTHON_BUILD_STANDALONE_VERSION: 20240909
run: |
# Find cpython-${PYTHON_VERSION}+${version}-${arch}-unknown-linux-musl-install_only.tar.gz
VERSION="$(
curl --silent --show-error --location --fail \
--url "https://api.github.com/repos/indygreg/python-build-standalone/releases/tags/${INDYGREG_PYTHON_BUILD_STANDALONE_VERSION}" \
| jq --raw-output '.assets[].name' \
| grep -E -- '-x86_64-unknown-linux-musl-install_only.tar.gz$' \
| sed -E 's/^cpython-([^+]+)\+.+$/\1/' \
| grep -P '^\d+\.\d+\.\d+$' \
| sort -Vr \
| head -n 1
)"
if test -z "${VERSION}"; then
echo "Failed to fetch latest tag and extract version from GitHub"
exit 1
fi
echo "Got version <${VERSION}>"
echo "version=${VERSION}.${INDYGREG_PYTHON_BUILD_STANDALONE_VERSION}" >>${GITHUB_OUTPUT}
- name: Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
allowUpdates: true
name: "python v${{ steps.fetch.outputs.version }}"
tag: python/${{ steps.fetch.outputs.version }}
draft: false
prerelease: false