From 91bc5c961dfaa0ed2b43af4c7980ec959e9c9774 Mon Sep 17 00:00:00 2001 From: Joe Dong Date: Wed, 5 Jun 2024 09:58:06 +0800 Subject: [PATCH] use manual trigger action --- .github/workflows/build.yaml | 70 +++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0a45e09..65ae44d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,10 +1,12 @@ name: Build on: - push: - branches: [main] - pull_request: - branches: [main] + workflow_dispatch: + inputs: + tag: + description: 'Tag to build' + required: true + default: 'v*' jobs: build: @@ -12,33 +14,35 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.9, 3.10, 3.11, 3.12] - + python-version: [3.12] + steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pybind11==2.11.0 pybind11-global==2.11.0 wheel - - - name: Configure CMake - run: cmake -S . -B build -DPYBIND11_PYTHON_VERSION=${{ matrix.python-version }} - - - name: Build - run: cmake --build build --config Release - - - name: Build Python Wheel - run: | - python setup.py bdist_wheel - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: python-wheel-${{ matrix.os }}-${{ matrix.python-version }} - path: build/dist/*.whl + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.tag }} + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pybind11==2.11.0 pybind11-global==2.11.0 wheel + + - name: Configure CMake + run: cmake -S . -B build -DPYBIND11_PYTHON_VERSION=${{ matrix.python-version }} + + - name: Build + run: cmake --build build --config Release + + - name: Build Python Wheel + run: | + python setup.py bdist_wheel + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: python-wheel-${{ matrix.os }}-${{ matrix.python-version }} + path: dist/*.whl \ No newline at end of file