Skip to content

Setup release CI

Setup release CI #13

Workflow file for this run

name: Daily Build
on:
schedule:
- cron: '0 0 * * *' # Schedule to run daily at midnight
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
download_area: ["CN", "EU"]
cuda-version: [cu118, cu121, cu122]
env:
CUDA_VERSION: ${{ matrix.cuda-version }}
steps:
- name: Checkout private onediff
uses: actions/checkout@v2
with:
ref: opt_setup_ci
repository: siliconflow/${{ secrets.ONEDIFF_ENTERPRISE }}
token: ${{ secrets.WHEEL_TOKEN }}
- name: Checkout onediff_release
uses: actions/checkout@v2
with:
ref: setup_release_ci
repository: siliconflow/onediff_releases
path: onediff_releases
token: ${{ secrets.WHEEL_TOKEN }}
- name: Python wheels manylinux build
uses: RalfG/[email protected]
with:
python-versions: 'cp310-cp310 cp311-cp311'
build-requirements: 'Cython==3.0.8 requests==2.31.0 beautifulsoup4==4.12.3'
pip-wheel-args: '-w ./wheels/${{ matrix.cuda-version }} --no-deps'
env:
DOWNLOAD_AREA: ${{ matrix.download_area }}
- name: Create release with assests
run: |
sudo find ./wheels/${{ matrix.cuda-version }} -type f ! -name '*manylinux*' -exec rm {} +
sudo python onediff_releases/generate_pypi_index.py ./wheels/${{ matrix.cuda-version }}
find ./wheels -type f
- name: Setup ossutil
if: github.repository == 'siliconflow/onediff_releases' && matrix.download_area == 'CN'
run: |
if [ ! -f "$HOME/ossutil64" ]; then
curl http://gosspublic.alicdn.com/ossutil/1.7.15/ossutil64 -o $HOME/ossutil64
chmod +x $HOME/ossutil64
fi
$HOME/ossutil64 config -e oss-cn-beijing.aliyuncs.com -i ${{ secrets.OSS_ACCESS_KEY_ID }} -k ${{ secrets.OSS_ACCESS_KEY_SECRET }} -L EN -c $HOME/.ossutilconfig
- name: Publish to OSS
if: matrix.download_area == 'CN'
run: |
$HOME/ossutil64 cp --disable-ignore-error --update --recursive ./wheels/${{ matrix.cuda-version }} ${{ secrets.ONEDIFF_OSS_URL }}/${{ matrix.cuda-version }}
- name: Set Date
if: matrix.download_area == 'EU'
id: set_date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Publish archives
if: matrix.download_area == 'EU'
uses: ncipollo/[email protected]
with:
artifacts: "./wheels/${{ matrix.cuda-version }}/*.whl"
token: "${{ secrets.WHEEL_TOKEN }}"
tag: enterprise-${{ matrix.cuda-version }}
name: latest enterprise-${{ matrix.cuda-version }}-${{ env.DATE }}
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: false