From 74d9375873fb97bfcfa78871e42df1a711b2d704 Mon Sep 17 00:00:00 2001 From: HansBug Date: Thu, 14 Jul 2022 17:22:42 +0800 Subject: [PATCH] release(hansbug): fix the release problem && use matrix.os instead of runner.os --- .github/workflows/release.yml | 76 ++++++++++++++++++++++++++++-- .github/workflows/release_test.yml | 2 +- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e46def0fc..8cd2d74ea3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: source_release: - name: Publish source package to official pypi + name: Build and publish the source package runs-on: ${{ matrix.os }} if: ${{ github.repository == 'opendilab/treevalue' }} strategy: @@ -41,17 +41,18 @@ jobs: with: password: ${{ secrets.PYPI_PASSWORD }} verbose: true + skip_existing: true - name: Upload distribution 📦 to github release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: dist/* tag: ${{ github.ref }} + overwrite: false file_glob: true - - wheel_release: - name: Try build the wheels + wheel_build: + name: Build the wheels runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -114,6 +115,71 @@ jobs: CIBW_ARCHS: ${{ matrix.architecture }} CIBW_PROJECT_REQUIRES_PYTHON: ~=${{ matrix.python }}.0 + - name: Show the buildings + shell: bash + run: | + ls -al ./wheelhouse + - name: Upload packed files to artifacts + uses: actions/upload-artifact@v3 + with: + name: build-artifacts-${{ matrix.os }}-cp${{ matrix.python }}-${{ matrix.architecture }} + path: ./wheelhouse + + # the publishing can only be processed on linux system + wheel_publish: + name: Publish the wheels to pypi + runs-on: ubuntu-18.04 + needs: + - wheel_build + strategy: + fail-fast: false + matrix: + os: + - 'ubuntu-18.04' + - 'windows-2019' + - 'macos-10.15' + python: + - '3.6' + - '3.7' + - '3.8' + - '3.9' + - '3.10' + architecture: + - x86_64 + - arm64 + - aarch64 + - x86 + - AMD64 + exclude: + - os: ubuntu-18.04 + architecture: arm64 + - os: ubuntu-18.04 + architecture: x86 + - os: ubuntu-18.04 + architecture: AMD64 + - os: windows-2019 + architecture: x86_64 + - os: windows-2019 + architecture: arm64 + - os: windows-2019 + architecture: aarch64 + - os: macos-10.15 + architecture: aarch64 + - os: macos-10.15 + architecture: x86 + - os: macos-10.15 + architecture: AMD64 + - python: '3.6' + architecture: arm64 + - python: '3.7' + architecture: arm64 + + steps: + - name: Download packed files to artifacts + uses: actions/download-artifact@v3 + with: + name: build-artifacts-${{ matrix.os }}-cp${{ matrix.python }}-${{ matrix.architecture }} + path: ./wheelhouse - name: Show the buildings shell: bash run: | @@ -123,6 +189,7 @@ jobs: with: password: ${{ secrets.PYPI_PASSWORD }} verbose: true + skip_existing: true packages_dir: wheelhouse/ - name: Upload distribution 📦 to github release uses: svenstaro/upload-release-action@v2 @@ -130,4 +197,5 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: wheelhouse/* tag: ${{ github.ref }} + overwrite: false file_glob: true diff --git a/.github/workflows/release_test.yml b/.github/workflows/release_test.yml index 61d714fa8c..d62f682a96 100644 --- a/.github/workflows/release_test.yml +++ b/.github/workflows/release_test.yml @@ -110,7 +110,7 @@ jobs: run: | ls -al ./wheelhouse - name: Upload packed files to artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: build-artifacts-${{ runner.os }}-cp${{ matrix.python }}-${{ matrix.architecture }} path: ./wheelhouse/* -- GitLab