Main #22
Workflow file for this run
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: Main | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: taiki-e/create-gh-release-action@v1 | |
| with: | |
| # (optional) Path to changelog. | |
| changelog: CHANGELOG.md | |
| # (required) GitHub token for creating GitHub Releases. | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| build_x86_64: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: ubuntu-22.04 | |
| target: x86_64 | |
| - runner: windows-latest | |
| target: x86_64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| rustflags: "-C target-feature=+sse4.2 -C target-feature=+avx2 -C target-feature=+pclmulqdq" | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Build Msd | |
| run: cargo build --release --bin msd | |
| - name: Build Python Binding | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: build | |
| args: --release -m bindings/python/Cargo.toml | |
| - name: Collect wheels | |
| run: | | |
| python3 tests/scripts/wheels.py $GITHUB_REF_NAME >> $GITHUB_ENV | |
| shell: bash | |
| - name: Archive wheels | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: wheels-${{ matrix.platform.runner }}-${{ matrix.platform.target }} | |
| path: ./target/wheels/pymsd-${{ env.MSD_VERSION }}*.whl | |
| overwrite: true | |
| - name: Upload Rust Binary | |
| uses: taiki-e/upload-rust-binary-action@v1 | |
| with: | |
| bin: msd | |
| asset: ${{ env.MSD_WHEELS }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| build_aarch64: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: macos-14 | |
| target: aarch64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Build Msd | |
| run: cargo build --release --bin msd | |
| - name: Build Python Binding | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: build | |
| args: --release -m bindings/python/Cargo.toml | |
| - name: Collect wheels | |
| run: | | |
| ls -R ./target/wheels | |
| python3 tests/scripts/wheels.py $GITHUB_REF_NAME >> $GITHUB_ENV | |
| shell: bash | |
| - name: Archive wheels | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: wheels-${{ matrix.platform.runner }}-${{ matrix.platform.target }} | |
| path: ./target/wheels/pymsd-${{ env.MSD_VERSION }}*.whl | |
| overwrite: true | |
| compression-level: 0 | |
| - name: Upload Rust Binary | |
| uses: taiki-e/upload-rust-binary-action@v1 | |
| with: | |
| bin: msd | |
| asset: ${{ env.MSD_WHEELS }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_python: | |
| runs-on: ubuntu-latest | |
| needs: [build_x86_64, build_aarch64] | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download wheels | |
| uses: actions/download-artifact@v7 | |
| with: | |
| path: ./dist | |
| merge-multiple: true | |
| - name: Display structure of downloaded files | |
| run: ls -R . | |
| - name: upload release to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |