diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index b00e297..f9291f0 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -35,3 +35,7 @@ jobs: python3 -m build --outdir=dist --wheel python3 -m pip install --no-index --find-links=dist pypff-stubs mypy --strict -c 'import pypff; reveal_type(pypff.file)' + - name: Upload wheels + run: | + ./upload-wheel.sh dist/libpff_python*.whl + ./upload-wheel.sh stubs/dist/pypff_stubs*.whl diff --git a/upload-wheel.sh b/upload-wheel.sh new file mode 100755 index 0000000..b38acd6 --- /dev/null +++ b/upload-wheel.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euo pipefail + +wheel="$1" +url="s3://everlaw-build-artifacts/libpff/$(basename "$wheel")" + +if aws s3 ls "$url" &>/dev/null; then + >&2 echo "$url already exists!" + exit 0 +fi + +aws s3 cp --only-show-errors "$wheel" "$url" +>&2 echo "Uploaded $url"