diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6df4aac..31abe03 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,7 +22,7 @@ jobs: python-version: ['3.8', '3.9'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.12.1 @@ -71,7 +71,7 @@ jobs: shell: bash run: ctest -C $BUILD_TYPE --verbose - - name: Push binaries + - name: Stage binaries if: | contains(matrix.os, 'latest') && contains(matrix.python-version, '3.9') && @@ -81,5 +81,25 @@ jobs: git config --global user.name $GH_USERNAME git config --global user.email $GH_USERNAME@users.noreply.github.com git config --global pull.rebase false + git stash + git pull + git stash apply git add ${{ github.workspace }}/pyfunnel/lib - git diff-index --quiet HEAD || { git commit -m "Add ${{ matrix.os }} binaries" && git pull && git push; } + + - name: Push Linux & macOS binaries + if: | + (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest') && + contains(matrix.python-version, '3.9') && + github.event_name == 'push' && + github.ref == 'refs/heads/master' + run: | + git diff-index --quiet HEAD || { git commit -m "Add ${{ matrix.os }} binaries" && git push; } + + - name: Push Windows binaries + if: | + matrix.os == 'windows-latest' && + contains(matrix.python-version, '3.9') && + github.event_name == 'push' && + github.ref == 'refs/heads/master' + run: | + git diff-index --quiet HEAD; if(-not $?) { (git commit -m "Add ${{ matrix.os }} binaries") -and (git push) }