Update backup_to_sourceforge.yaml #31
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
name: Download PyPI Packages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
download: | |
# runs-on: [arc12] | |
runs-on: ubuntu-latest | |
env: | |
SOURCEFORGE_PW: '${{ secrets.SOURCEFORGE_PW }}' | |
WHL_VERSION: "2.5.0b20240603" # 将版本号存储在环境变量中 | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests beautifulsoup4 | |
- name: Fetch wheel links | |
run: | | |
rm -rf wheels | |
mkdir -p wheels | |
cd wheels | |
pwd | |
python <<EOF | |
import requests | |
from bs4 import BeautifulSoup | |
url = "https://pypi.org/simple/bigdl-core-xe-batch-21/" | |
response = requests.get(url) | |
if response.status_code != 200: | |
print(f"Failed to retrieve the page: {response.status_code}") | |
exit(1) | |
soup = BeautifulSoup(response.content, 'html.parser') | |
links = soup.find_all('a', href=True) | |
wheel_links = [] | |
for link in links: | |
href = link['href'] | |
if '2.5.0b20240603' in href and '.whl' in href: | |
href = href.split('#')[0] # 去除哈希部分 | |
wheel_links.append(href) | |
with open("wheel_links.txt", "w") as f: | |
for wheel_link in wheel_links: | |
f.write(f"{wheel_link}\n") | |
EOF | |
ls | |
pwd | |
- name: Download wheel files | |
run: | | |
cd wheels | |
pwd | |
wget --no-check-certificate -i wheel_links.txt | |
ls | |
pwd | |
# - name: copy file via ssh password | |
# uses: appleboy/[email protected] | |
# with: | |
# host: frs.sourceforge.net | |
# username: intelanalytics | |
# password: ${{ secrets.SOURCEFORGE_PW }} | |
# source: "wheels/bigdl_core_xe_batch_21-2.5.0b20240603-cp310-cp310-manylinux2010_x86_64.whl" | |
# target: /home/frs/project/analytics-zoo/bigdl-llm-whl/bigdl-core-xe-batch-21/${{ env.WHL_VERSION }}/ | |
- name: Upload Wheels to SourceForge | |
run: | | |
pwd | |
ls | |
rsync -avzr -v \ | |
-e "sshpass -p '1234qwer\!@\#\$QWER' ssh -vvv -o StrictHostKeyChecking=no " \ | |
wheels/*.whl [email protected]:/home/frs/project/analytics-zoo/bigdl-llm-whl/bigdl-core-xe-batch-21/${{ env.WHL_VERSION }}/ |