minor fix #6
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: Build HDF5 Filter | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| release: | |
| types: [ published ] | |
| # Need write permission to upload release assets | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| arch: amd64 | |
| lib_name: libh5z_ebcc.so | |
| archive_name: ebcc-h5plugin-linux-amd64.zip | |
| - os: ubuntu-latest | |
| arch: arm64 | |
| lib_name: libh5z_ebcc.so | |
| archive_name: ebcc-h5plugin-linux-arm64.zip | |
| # - os: windows-latest | |
| # arch: amd64 | |
| # lib_name: h5z_ebcc.dll | |
| # archive_name: ebcc-h5plugin-windows-amd64.zip | |
| - os: macos-latest | |
| arch: arm64 | |
| lib_name: libh5z_ebcc.dylib | |
| archive_name: ebcc-h5plugin-macos-arm64.zip | |
| steps: | |
| - name: Checkout repository and submodules | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install wheel cmake | |
| - name: Build wheel | |
| run: pip wheel . -w dist --no-deps | |
| - name: Unpack wheel and find library | |
| shell: bash | |
| run: | | |
| # Unzip the wheel file to a temporary directory | |
| unzip dist/*.whl -d wheel_contents | |
| # Find the library file and move it to a known location | |
| find wheel_contents -name "${{ matrix.lib_name }}" -exec mv {} . \; | |
| - name: Archive dynamic library (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: zip ${{ matrix.archive_name }} ${{ matrix.lib_name }} | |
| - name: Archive dynamic library (Windows) | |
| if: runner.os == 'Windows' | |
| shell: powershell | |
| run: Compress-Archive -Path ${{ matrix.lib_name }} -DestinationPath ${{ matrix.archive_name }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.archive_name }} | |
| path: ${{ matrix.archive_name }} | |
| - name: Run HDF5 example | |
| shell: bash | |
| run: | | |
| python -m pip install . | |
| PYTHONPATH=. python examples/example_hdf5.py | |
| - name: Upload asset to GitHub Release | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ matrix.archive_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |