Enable Release Pypi workflow to be called in another repo (#11483)
This commit is contained in:
		
							parent
							
								
									fb4774b076
								
							
						
					
					
						commit
						a1164e45b6
					
				
					 2 changed files with 78 additions and 65 deletions
				
			
		
							
								
								
									
										65
									
								
								.github/workflows/nightly_build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										65
									
								
								.github/workflows/nightly_build.yml
									
									
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -1,65 +0,0 @@
 | 
			
		|||
name: Nightly Build
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  # pull_request:
 | 
			
		||||
  #   branches: [ main ]
 | 
			
		||||
  #   paths:
 | 
			
		||||
  #     - '.github/workflows/nightly_build.yml'
 | 
			
		||||
  schedule:
 | 
			
		||||
    - cron: '00 15 * * *'  # GMT time, 15:00 GMT == 23:00 China
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
 | 
			
		||||
env:
 | 
			
		||||
  GIST_ID: 48dbd87983219d4fe264adfea701815a
 | 
			
		||||
 | 
			
		||||
permissions:
 | 
			
		||||
  contents: read
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  
 | 
			
		||||
  llm-cpp-build:
 | 
			
		||||
    uses: ./.github/workflows/llm-binary-build.yml
 | 
			
		||||
 | 
			
		||||
  ipex-llm-build:
 | 
			
		||||
    # python build can only be published once a day, please do not publish it manually
 | 
			
		||||
    if: ${{ github.event.schedule || github.event_name == 'workflow_dispatch' }} 
 | 
			
		||||
    runs-on: [self-hosted, Bree]
 | 
			
		||||
    needs: llm-cpp-build
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
 | 
			
		||||
 | 
			
		||||
    - name: Set up Python 
 | 
			
		||||
      uses: actions/setup-python@v2
 | 
			
		||||
      with:
 | 
			
		||||
        python-version: '3.7.15'
 | 
			
		||||
 | 
			
		||||
    - name: Install dependencies
 | 
			
		||||
      run: |
 | 
			
		||||
        python -m pip install --upgrade pip
 | 
			
		||||
        pip install build
 | 
			
		||||
        pip install wheel
 | 
			
		||||
        pip install twine
 | 
			
		||||
 | 
			
		||||
    - name: Download llm binary
 | 
			
		||||
      uses: ./.github/actions/llm/download-llm-binary
 | 
			
		||||
 | 
			
		||||
    - name: Build package
 | 
			
		||||
      run: |
 | 
			
		||||
        export TIMESTAMP=`date '+%Y%m%d'`
 | 
			
		||||
        # export TIMESTAMP=20240323
 | 
			
		||||
        export PYPI_VERSION=2.1.0
 | 
			
		||||
        nb_version=${PYPI_VERSION}b${TIMESTAMP}
 | 
			
		||||
        echo ${nb_version}
 | 
			
		||||
 | 
			
		||||
        ## windows ##
 | 
			
		||||
        bash python/llm/dev/release_default_windows.sh ${nb_version} true
 | 
			
		||||
 | 
			
		||||
        ## linux ##
 | 
			
		||||
        bash python/llm/dev/release_default_linux.sh ${nb_version} true
 | 
			
		||||
 | 
			
		||||
  docker-build:
 | 
			
		||||
    if: ${{ github.event.schedule }} 
 | 
			
		||||
    uses: ./.github/workflows/manually_build.yml
 | 
			
		||||
    with:
 | 
			
		||||
      artifact: all
 | 
			
		||||
      tag: 2.1.0-SNAPSHOT
 | 
			
		||||
							
								
								
									
										78
									
								
								.github/workflows/release-pypi.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								.github/workflows/release-pypi.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,78 @@
 | 
			
		|||
name: Nightly Release
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  # pull_request:
 | 
			
		||||
  #   branches: [ main ]
 | 
			
		||||
  #   paths:
 | 
			
		||||
  #     - '.github/workflows/nightly_build.yml'
 | 
			
		||||
  # schedule:
 | 
			
		||||
  #   - cron: '00 15 * * *'  # GMT time, 15:00 GMT == 23:00 China
 | 
			
		||||
  # workflow_dispatch:
 | 
			
		||||
  workflow_call:
 | 
			
		||||
    inputs:
 | 
			
		||||
      checkout-ref:
 | 
			
		||||
        description: 'ref for checking out, including branch, tag or SHA'
 | 
			
		||||
        required: false
 | 
			
		||||
        type: string
 | 
			
		||||
      release-version:
 | 
			
		||||
        description: 'ipex-llm version (e.g. 2.1.0b1)'
 | 
			
		||||
        required: false
 | 
			
		||||
        type: string
 | 
			
		||||
      schedule-event:
 | 
			
		||||
        description: 'whether it is triggered by schedule event'
 | 
			
		||||
        required: true
 | 
			
		||||
        type: boolean
 | 
			
		||||
permissions:
 | 
			
		||||
  contents: read
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
 | 
			
		||||
  llm-cpp-build:
 | 
			
		||||
    uses: ./.github/workflows/llm-binary-build.yml
 | 
			
		||||
 | 
			
		||||
  ipex-llm-build:
 | 
			
		||||
    # python build can only be published once a day, please do not publish it manually
 | 
			
		||||
    # if: ${{ github.event.schedule || github.event_name == 'workflow_dispatch' }} 
 | 
			
		||||
    runs-on: [self-hosted, Bree]
 | 
			
		||||
    needs: llm-cpp-build
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
 | 
			
		||||
      with:
 | 
			
		||||
        repository: 'intel-analytics/ipex-llm'
 | 
			
		||||
        ref: ${{ github.event.inputs.checkout-ref }}
 | 
			
		||||
 | 
			
		||||
    - name: Set up Python 
 | 
			
		||||
      uses: actions/setup-python@v2
 | 
			
		||||
      with:
 | 
			
		||||
        python-version: '3.7.15'
 | 
			
		||||
 | 
			
		||||
    - name: Install dependencies
 | 
			
		||||
      run: |
 | 
			
		||||
        python -m pip install --upgrade pip
 | 
			
		||||
        pip install build
 | 
			
		||||
        pip install wheel
 | 
			
		||||
        pip install twine
 | 
			
		||||
 | 
			
		||||
    - name: Download llm binary
 | 
			
		||||
      uses: ./.github/actions/llm/download-llm-binary
 | 
			
		||||
 | 
			
		||||
    - name: set release version
 | 
			
		||||
      run: |
 | 
			
		||||
        if [[ "${{ github.event.inputs.schedule-event }}" == "true" ]]; then
 | 
			
		||||
          export TIMESTAMP=`date '+%Y%m%d'`
 | 
			
		||||
          export PYPI_VERSION=2.1.0
 | 
			
		||||
          export RELEASE_VERSION=${PYPI_VERSION}b${TIMESTAMP}
 | 
			
		||||
        else
 | 
			
		||||
          export RELEASE_VERSION=${{ github.event.inputs.release-version }}
 | 
			
		||||
        fi
 | 
			
		||||
        echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
 | 
			
		||||
 | 
			
		||||
    - name: Build package
 | 
			
		||||
      run: |
 | 
			
		||||
        echo ${RELEASE_VERSION}
 | 
			
		||||
 | 
			
		||||
        ## windows ##
 | 
			
		||||
        bash python/llm/dev/release_default_windows.sh ${RELEASE_VERSION} true
 | 
			
		||||
 | 
			
		||||
        ## linux ##
 | 
			
		||||
        bash python/llm/dev/release_default_linux.sh ${RELEASE_VERSION} true
 | 
			
		||||
		Loading…
	
		Reference in a new issue