Skip to content

build ruamel.yaml.clib wheel #318

build ruamel.yaml.clib wheel

build ruamel.yaml.clib wheel #318

name: build ruamel.yaml.clib wheel
on:
schedule:
- cron: '0 17 * * *'
workflow_dispatch:
inputs:
version:
required: false
default: 'latest'
env:
PACKAGE: ruamel.yaml.clib
jobs:
build:
name: Build ruamel.yaml.clib ${{ matrix.platform }} wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [loongarch64-abi2.0]
platform: ["manylinux", "musllinux"]
steps:
- name: Check if exists
run: |
pkg=${{ env.PACKAGE }}
if [[ "${{ github.event_name }}" == "schedule" ]]; then
version="latest"
else
version="${{ github.event.inputs.version }}"
fi
platform="${{ matrix.platform }}"
url="https://lpypi.loongnix.cn/loongson/pypi/+simple/${pkg}/"
upstream_url="https://pypi.org/pypi/${pkg}/json"
if [[ "${version}" == "latest" ]]; then
version="$(curl -s ${upstream_url} | jq -r '.info.version')"
fi
if curl -Ls ${url} | grep -q ${pkg}-${version}-.*${platform}.*loongarch64; then
echo "SKIP=true" >> $GITHUB_ENV
echo "${platform} wheels already exists."
else
echo "SKIP=false" >> $GITHUB_ENV
echo "${platform} wheels not found, continue building"
fi
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Clean workspace
if: ${{ env.SKIP != 'true' }}
run: |
safe-rm -rf * .*
- name: Download source
if: ${{ env.SKIP != 'true' }}
uses: Loongson-Cloud-Community/pypi@main
with:
name: ${{ env.PACKAGE }}
version: ${{ env.VERSION }}
- name: Build wheel
if: ${{ env.SKIP != 'true' }}
run: |
pip3 install -i https://lpypi.loongnix.cn/loongson/pypi/+simple cibuildwheel==2.22.0
cibuildwheel
env:
PIP_EXTRA_INDEX_URL: "https://lpypi.loongnix.cn/loongson/pypi/+simple"
PIP_INDEX_URL: "https://pypi.tuna.tsinghua.edu.cn/simple"
CIBW_ARCHS: "loongarch64"
CIBW_BUILD: "*-${{ matrix.platform }}_loongarch64"
CIBW_SKIP: "cp36-* cp37-* cp38-*"
CIBW_ENVIRONMENT_PASS_LINUX: >
PIP_INDEX_URL
PIP_EXTRA_INDEX_URL
- name: Upload wheels
if: ${{ env.SKIP != 'true' }}
run: |
ls wheelhouse/*-${{ matrix.platform }}_*.whl || exit 1
twine upload --repository-url https://lpypi.loongnix.cn/loongson/pypi wheelhouse/*-${{ matrix.platform }}_*.whl
env:
TWINE_USERNAME: ${{ secrets.INDEX_NAME }}
TWINE_PASSWORD: ${{ secrets.INDEX_TOKEN }}