chore: prepare release (#26) #20
Workflow file for this run
This file contains 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: Release to PyPI | |
on: | |
push: | |
tags: ["v*"] | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
jobs: | |
validate-release-tag: | |
name: Validate git tag | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: compare git tag with cargo metadata | |
working-directory: object-store/ | |
run: | | |
PUSHED_TAG=${GITHUB_REF##*/} | |
CURR_VER=$( grep version Cargo.toml | head -n 1 | awk '{print $3}' | tr -d '"' ) | |
if [[ "${PUSHED_TAG}" != "v${CURR_VER}" ]]; then | |
echo "Cargo metadata has version set to ${CURR_VER}, but got pushed tag ${PUSHED_TAG}." | |
exit 1 | |
fi | |
release-pypi-mac: | |
needs: validate-release-tag | |
name: PyPI release on Mac | |
runs-on: macos-11 | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86_64-apple-darwin, aarch64-apple-darwin] | |
steps: | |
- uses: actions/checkout@v3 | |
- run: rm object-store/README.md && cp README.md object-store/README.md | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- uses: PyO3/maturin-action@v1 | |
name: Publish to pypi (without sdist) | |
with: | |
target: ${{ matrix.target }} | |
command: publish | |
args: -m object-store/Cargo.toml --no-sdist | |
release-pypi-mac-universal2: | |
needs: validate-release-tag | |
name: PyPI release on Mac universal 2 | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: rm object-store/README.md && cp README.md object-store/README.md | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- uses: PyO3/maturin-action@v1 | |
name: Publish to pypi (without sdist) | |
with: | |
target: ${{ matrix.target }} | |
command: publish | |
args: -m object-store/Cargo.toml --no-sdist --universal2 | |
release-pypi-windows: | |
needs: validate-release-tag | |
name: PyPI release on Windows | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: rm object-store/README.md && cp README.md object-store/README.md | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- uses: PyO3/maturin-action@v1 | |
name: Publish to pypi (without sdist) | |
with: | |
target: x86_64-pc-windows-msvc | |
command: publish | |
args: -m object-store/Cargo.toml --no-sdist | |
release-pypi-manylinux: | |
needs: validate-release-tag | |
name: PyPI release manylinux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: rm object-store/README.md && cp README.md object-store/README.md | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- uses: PyO3/maturin-action@v1 | |
name: Publish manylinux to pypi x86_64 (with sdist) | |
with: | |
target: x86_64-unknown-linux-gnu | |
command: publish | |
args: -m object-store/Cargo.toml | |
- uses: PyO3/maturin-action@v1 | |
name: Publish manylinux to pypi aarch64 (without sdist) | |
with: | |
target: aarch64-unknown-linux-gnu | |
command: publish | |
args: -m object-store/Cargo.toml --no-sdist |