Skip to content

Commit

Permalink
chore(release): update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cauliyang committed Oct 24, 2023
1 parent 6dea23e commit 0d2e97f
Showing 1 changed file with 59 additions and 54 deletions.
113 changes: 59 additions & 54 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,60 +59,65 @@ jobs:
version=$(poetry version | awk '{ print $2 }') &&
poetry version $version.dev.$(date +%s)
# build_wheels_linux:
# name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
# cibw_archs: ["x86_64"]

# steps:
# - name: Check out repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 0

# - name: Set up QEMU
# if: matrix.cibw_archs != 'x86_64'
# uses: docker/setup-qemu-action@v2
# with:
# platforms: all

# - name: Set up python 3.11
# uses: actions/setup-python@v4
# with:
# python-version: "3.11"

# - name: Install poetry
# uses: snok/install-poetry@v1
# with:
# virtualenvs-create: false
# virtualenvs-in-project: false

# - name: Build wheels
# uses: pypa/[email protected]
# env:
# CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# CIBW_ARCHS: ${{ matrix.cibw_archs }}
# CIBW_BUILD: ${{ matrix.cibw_build }}
# CIBW_SKIP: "*musllinux*"

# - uses: actions/upload-artifact@v3
# with:
# path: wheelhouse/*.whl
build_wheels_linux:
name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
runs-on: ${{ matrix.os }}
needs: ["release"]
if: needs.release.check-version.outputs.tag

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_archs: ["x86_64"]

steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up QEMU
if: matrix.cibw_archs != 'x86_64'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Set up python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
virtualenvs-in-project: false

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_SKIP: "*musllinux*"

- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl

build_wheels_macos:
name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
runs-on: ${{ matrix.os }}
needs: ["release"]
if: needs.release.check-version.outputs.tag

strategy:
fail-fast: false
matrix:
os: [macos-latest]
# cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_build: ["cp39-*"]
cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_archs: ["x86_64"]
env:
SYSTEM_VERSION_COMPAT: 0 # https://github.com/actions/setup-python/issues/469#issuecomment-1192522949
Expand All @@ -122,10 +127,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up python 3.12
- name: Set up python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.10"

- name: Install poetry
uses: snok/install-poetry@v1
Expand Down Expand Up @@ -161,11 +166,12 @@ jobs:
build_wheels_macos_arm64:
name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
runs-on: ${{ matrix.os }}
needs: ["release"]
if: needs.release.check-version.outputs.tag
strategy:
matrix:
os: [macos-latest]
# cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_build: ["cp39-*"]
cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
cibw_archs: ["arm64"]

steps:
Expand All @@ -176,7 +182,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.10"

- name: Configure Homebrew
uses: Homebrew/actions/setup-homebrew@master
Expand Down Expand Up @@ -227,7 +233,6 @@ jobs:
path: ./wheelhouse/*.whl

upload_to_pypi:
# needs: ["release", "build_wheels_linux"]
needs: ["release", "build_wheels_macos_arm64", "build_wheels_macos"]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -255,7 +260,7 @@ jobs:
- name: Publish the release notes
uses: release-drafter/[email protected]
with:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
publish: ${{ needs.release.check-version.outputs.tag != '' }}
tag: ${{ needs.release.check-version.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0d2e97f

Please sign in to comment.