File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 - name : Build PyPi package
6161 run : uv run maturin build --release --out dist
6262 - name : Publish PyPi package
63- # TODO: Remove || true
64- run : uv run maturin publish --username __token__ --password ${{ secrets.PYPI_TOKEN }} || true
63+ run : uv run maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }}
6564 linux :
6665 runs-on : ${{ matrix.platform.runner }}
6766 needs : publish
Original file line number Diff line number Diff line change 5151 uses : actions-rust-lang/setup-rust-toolchain@v1
5252
5353 - name : Publish to crates.io
54- run : cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
54+ run : |
55+ VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
56+ if cargo search cloudcheck --limit 1 | head -1 | grep -q "$VERSION"; then
57+ echo "Version $VERSION already exists on crates.io, skipping publish"
58+ else
59+ cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
60+ fi
Original file line number Diff line number Diff line change 1+ import os
12import sys
23from cloudcheck_update import update
34
45
56def main ():
7+ threshold = int (os .environ .get ("ERROR_THRESHOLD" , 10 ))
68 errors = update ()
79 for error in errors :
810 print (error )
9- return 1 if errors else 0
11+ error_count = len (errors )
12+ if error_count > threshold :
13+ print (f"Error count ({ error_count } ) exceeds threshold ({ threshold } )" )
14+ return 1
15+ elif error_count > 0 :
16+ print (f"Error count ({ error_count } ) within threshold ({ threshold } )" )
17+ return 0
1018
1119
1220if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments