Repository navigation
Bump actions/checkout from 5 to 6 (#78) #102
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy release | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/deploy.yml' | |
| - 'pyproject.toml' | |
| workflow_dispatch: | |
| jobs: | |
| build_wheels: | |
| name: Build wheels for ${{ matrix.os }} (${{ matrix.architectures }}) | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| architectures: "x86_64" | |
| - os: ubuntu-24.04-arm | |
| architectures: "aarch64" | |
| - os: macos-latest | |
| architectures: "x86_64 arm64 universal2" | |
| - os: windows-latest | |
| architectures: "AMD64 ARM64" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Download xmipp4-core binaries # TODO: Remove when xmipp4-core is in Pypi | |
| run: | | |
| git clone https://github.com/gigabit-clowns/xmipp4-core.git ./local_deps/xmipp4-core | |
| cd ./local_deps/xmipp4-core | |
| git checkout tags/development | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.3.0 | |
| env: | |
| CIBW_ARCHS: "${{ matrix.architectures }}" | |
| CIBW_ENVIRONMENT: 'PIP_FIND_LINKS=local_deps/xmipp4-core/dist' # TODO: Remove when xmipp4-core is in Pypi | |
| CIBW_BEFORE_BUILD_WINDOWS: | # FIXME this should not be required | |
| pip install git+https://github.com/gigabit-clowns/xmipp4-core@main | |
| CIBW_TEST_SKIP: "*-win_arm64" # Windows on ARM cannot be tested, raises warning | |
| CIBW_SKIP: "cp3??t-win*" # Skip Python free-threaded builds on Windows | |
| CIBW_REPAIR_WHEEL_COMMAND_LINUX: > | |
| auditwheel repair -w {dest_dir} {wheel} | |
| --exclude "libxmipp4-core.so*" | |
| CIBW_REPAIR_WHEEL_COMMAND_MACOS: > | |
| delocate-wheel --require-archs {delocate_archs} | |
| -w {dest_dir} -v {wheel} | |
| --ignore-missing-dependencies | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
| path: ./wheelhouse/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download xmipp4-core binaries # TODO: Remove when xmipp4-core is in Pypi | |
| working-directory: ${{ github.workspace }}/../ | |
| run: | | |
| git clone https://github.com/gigabit-clowns/xmipp4-core.git | |
| cd xmipp4-core | |
| git checkout tags/development | |
| - name: Install build tool # TODO: Remove when xmipp4-core is in Pypi | |
| run: pip install build | |
| - name: Build sdist | |
| env: # TODO: Remove when xmipp4-core is in Pypi | |
| PIP_FIND_LINKS: "${{ github.workspace }}/../xmipp4-core/dist" | |
| run: python -m build --sdist # TODO: Remove when xmipp4-core is in Pypi | |
| # run: pipx run build --sdist # TODO: Enable when xmipp4-core is in Pypi | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: cibw-sdist | |
| path: dist/*.tar.gz | |
| upload_pypi: | |
| name: Upload to PyPI | |
| needs: [build_wheels, build_sdist] | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| pattern: cibw-* | |
| path: dist | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: ls -l ./dist | |
| - name: Upload to PyPI # TODO enable this in the future | |
| if: false | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| create_developer_release: | |
| name: Create development release | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' | |
| env: | |
| TAG_NAME: "development" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Download artifacs | |
| uses: actions/download-artifact@v6 | |
| with: | |
| pattern: "cibw-*" | |
| path: dist | |
| merge-multiple: true | |
| - name: Create or update development tag | |
| run: | | |
| git config --global user.name 'GitHub Actions' | |
| git config --global user.email 'action@github.com' | |
| git add dist | |
| git commit -m "Add pre-built binaries" | |
| git tag -fa $TAG_NAME -m 'Update development tag with main branch' | |
| git push origin $TAG_NAME --force | |
| - name: Delete all old assets from development release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release view $TAG_NAME --json assets -q ".assets[].name" | while read asset; do | |
| gh release delete-asset $TAG_NAME "$asset" -y | |
| done | |
| - name: Create or update development release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| name: "Development build" | |
| body: >- | |
| This is an automated release containing binaries built with | |
| with the head of the main branch. | |
| draft: false | |
| prerelease: true | |
| files: dist/** |