Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publish and release workflows #47

Merged
merged 35 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3bb260c
Add publish and release workflows
flying-sheep Nov 18, 2024
eadfb29
whoops
flying-sheep Nov 18, 2024
1db2812
Merge branch 'main' into pa/release-publish
flying-sheep Nov 18, 2024
43b6fb3
unify
flying-sheep Nov 18, 2024
91e27c8
Merge branch 'main' into pa/release-publish
flying-sheep Nov 18, 2024
ea0f3a8
some fixes
flying-sheep Nov 18, 2024
4cf5331
abi3
flying-sheep Nov 18, 2024
2280ccc
2_28
flying-sheep Nov 18, 2024
f6c55c4
(fix): disable s390x in deployment
LDeakin Nov 18, 2024
1c7ea45
(fix): fix for x86_64 deployment perl issues
LDeakin Nov 18, 2024
4b9979a
(fix): try and fix i686 deployment
LDeakin Nov 18, 2024
25a5f57
(fix): softlink i686-linux-gnu-gcc
LDeakin Nov 18, 2024
b7b0edc
(fix): another try at i686
LDeakin Nov 18, 2024
3233a09
(fix): yet another try at i686
LDeakin Nov 18, 2024
6ed4bc6
(fix): disable i686 deployment for now
LDeakin Nov 18, 2024
d4e8bd7
(fix): try a stripped down alternative of 1c7ea45
LDeakin Nov 18, 2024
d9296ef
linux x86_64
flying-sheep Nov 18, 2024
7f4de6f
use dist
flying-sheep Nov 18, 2024
7048507
Merge branch 'main' into pa/release-publish
flying-sheep Nov 18, 2024
3ada2bb
(fix): set publish = false in Cargo.toml
LDeakin Nov 18, 2024
48ff131
(fix): add `_internal.pyi` to version control
LDeakin Nov 18, 2024
c5c8f63
get version
flying-sheep Nov 19, 2024
6ee4b5d
set name
flying-sheep Nov 19, 2024
e1dab2f
Merge branch 'main' into pa/release-publish
flying-sheep Nov 19, 2024
e120532
revert committing stubs
flying-sheep Nov 19, 2024
751a198
remove the submodule again
flying-sheep Nov 19, 2024
3f6f67a
Merge branch 'main' into pa/release-publish
flying-sheep Nov 19, 2024
effee03
(fix): ensure rustfmt is installed in CI
LDeakin Nov 19, 2024
73ef146
(fix): bump musllinux wheels to 1.2
LDeakin Nov 19, 2024
83fbb0c
(chore): temporarily publish to test.pypi.org
LDeakin Nov 20, 2024
3a1291c
(fix): remove redundant platforms in CI matrix
LDeakin Nov 20, 2024
64cf651
(chore): CI check package and tag version
LDeakin Nov 20, 2024
09e78ce
remove already-outdated comments
flying-sheep Nov 21, 2024
07d92a9
clarity
flying-sheep Nov 21, 2024
850178f
better version job
flying-sheep Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: cd

on:
push:
branches:
- main
tags:
- '**'
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: build on ${{ matrix.os }} (${{ matrix.target }}${{ matrix.os == 'linux' && format(' - {0}', matrix.manylinux == 'auto' && 'manylinux' || matrix.manylinux) || '' }})
# only run on push to main and on release
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build')
strategy:
fail-fast: false
matrix:
os: [linux, macos, windows]
target: [x86_64, aarch64]
manylinux: ['2_28']
include:
# manylinux for various platforms
- { os: linux, manylinux: '2_28', target: x86_64 }
#- { os: linux, manylinux: '2_28', target: i686 }
- { os: linux, manylinux: '2_28', target: aarch64 }
- { os: linux, manylinux: '2_28', target: armv7 }
- { os: linux, manylinux: '2_28', target: ppc64le }
#- { os: linux, manylinux: '2_28', target: s390x }
# musl
- { os: linux, manylinux: musllinux_1_1, target: x86_64 }
- { os: linux, manylinux: musllinux_1_1, target: aarch64 }
- { os: linux, manylinux: musllinux_1_1, target: armv7 }
# macos
- { os: macos, target: x86_64 }
- { os: macos, target: aarch64 }
# windows
- { os: windows, target: x86_64 }
- { os: windows, target: i686, python-architecture: x86 }
- { os: windows, target: aarch64 }
runs-on: ${{ (matrix.os == 'linux' && 'ubuntu') || matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
architecture: ${{ matrix.python-architecture || 'x64' }}
- run: pip install twine
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux }}
args: --release --out dist --interpreter '3.11 3.12 3.13'
rust-toolchain: stable
docker-options: -e CI
before-script-linux: |
# If we're running on rhel centos, install needed packages.
if command -v yum &> /dev/null; then
yum update -y && yum install -y perl-core
fi
- run: ${{ (matrix.os == 'windows' && 'dir') || 'ls -lh' }} dist/
- run: twine check --strict dist/*
- uses: actions/upload-artifact@v4
with:
name: pypi-wheels-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux }}
path: dist

inspect:
needs: build
outputs:
version: ${{ steps.version.outcome == 'success' && steps.version.outputs.full || '0.0.0' }}
prerelease: ${{ steps.version.outcome == 'success' && steps.version.outputs.prerelease || '' }}
runs-on: ubuntu-latest
steps:
# keep this the same as below in `publish`
- uses: actions/download-artifact@v4
with:
pattern: pypi-wheels-*
merge-multiple: true
path: dist/
- run: ls -lh dist/
- id: version
uses: release-kit/semver@v2
continue-on-error: true # continue if tag doesn’t match
with:
fallback: '0.0.0' # fall back if there is no tag
# TODO: some more checks? `twine` is already run above

publish:
if: needs.inspect.outputs.version != '0.0.0'
runs-on: ubuntu-latest
needs: inspect
environment: pypi
permissions:
id-token: write # to authenticate as Trusted Publisher to pypi.org
steps:
# keep this the same as above in `inspect`
- uses: actions/download-artifact@v4
with:
pattern: pypi-wheels-*
merge-multiple: true
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
- uses: ncipollo/release-action@v1
with:
name: ${{ needs.inspect.outputs.version }}
prerelease: ${{ needs.inspect.outputs.prerelease != '' }}
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: zarrs-python
name: ci

on:
push:
Expand All @@ -15,7 +15,7 @@ env:

jobs:
build_and_test:
name: zarrs-python
name: build and test
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
name = "zarrs-python"
version = "0.1.0"
edition = "2021"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "zarrs_python"
crate-type = ["cdylib", "rlib"]

[dependencies]
pyo3 = "0.22.6"
pyo3 = { version = "0.22.6", features = ["abi3-py311"] }
zarrs = "0.18.0-beta.0"
rayon_iter_concurrent_limit = "0.2.0"
rayon = "1.10.0"
Expand Down
1 change: 1 addition & 0 deletions zarrs_python
Submodule zarrs_python added at 66bca1
Loading