drop openssl dep (#24) #4
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
| on: | |
| push: | |
| tags: | |
| - v[0-9]+.* | |
| jobs: | |
| release: | |
| name: release ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-latest | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: DeterminateSystems/nix-installer-action@main | |
| - name: Build binary | |
| run: | | |
| nix develop --command cargo build --release \ | |
| --target ${{ matrix.target }} | |
| - name: Package and upload | |
| run: | | |
| TAG=${{ github.ref_name }} | |
| ARCHIVE="ferrex-${{ matrix.target }}-${TAG}" | |
| mkdir "${ARCHIVE}" | |
| cp "target/${{ matrix.target }}/release/ferrex" README.md LICENSE "${ARCHIVE}/" | |
| tar czf "${ARCHIVE}.tar.gz" "${ARCHIVE}" | |
| sha256sum "${ARCHIVE}.tar.gz" > "${ARCHIVE}.tar.gz.sha256" | |
| gh release upload "${TAG}" "${ARCHIVE}.tar.gz" "${ARCHIVE}.tar.gz.sha256" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-wheels: | |
| name: Build wheel ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| platform_tag: musllinux_1_2_x86_64 | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-latest | |
| platform_tag: musllinux_1_2_aarch64 | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| platform_tag: "" | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| platform_tag: "" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: DeterminateSystems/nix-installer-action@main | |
| - name: Build wheel | |
| run: | | |
| nix develop --command maturin build --release \ | |
| --target ${{ matrix.target }} \ | |
| --out dist | |
| - name: Fix platform tag | |
| if: ${{ matrix.platform_tag }} | |
| run: | | |
| import glob, os, re | |
| for whl in glob.glob("dist/*.whl"): | |
| new = re.sub(r"linux_[^.]+", "${{ matrix.platform_tag }}", whl) | |
| if new != whl: | |
| os.rename(whl, new) | |
| print(f"Renamed: {whl} -> {new}") | |
| shell: python | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheel-${{ matrix.target }} | |
| path: dist/*.whl | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: [build-wheels] | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| pattern: wheel-* | |
| merge-multiple: true | |
| path: dist | |
| - name: List wheels | |
| run: ls -la dist/ | |
| - name: Publish | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true |