Skip to content

Commit

Permalink
don't fail the publish CI step if pypi already published
Browse files Browse the repository at this point in the history
  • Loading branch information
lavie committed Sep 9, 2024
1 parent 0603a6c commit cc87b48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM docker
FROM docker:latest

ARG VERSION

RUN apk add --no-cache python3 py3-pip

RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
RUN pip3 install runlike==$VERSION

ENTRYPOINT ["runlike"]
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CUR_VER := $(shell poetry run ./current_version.py)
CUR_VER := $(shell poetry run $(PWD)/current_version.py)
SHELL := bash

.PHONY: build
Expand All @@ -23,7 +23,14 @@ test:
.PHONY: pypi
pypi:
poetry build
poetry publish -u __token__ -p $(POETRY_PYPI_TOKEN_PYPI)
@if ! poetry publish -u __token__ -p $(POETRY_PYPI_TOKEN_PYPI) 2>&1 | tee /dev/stderr | grep -q "HTTP Error 400: File already exists"; then \
if [ $$? -ne 0 ]; then \
echo "Error occurred during publish that was not 'File already exists'. Exiting."; \
exit 1; \
fi; \
else \
echo "Version $(CUR_VER) already exists on PyPI. Continuing..."; \
fi

.PHONY: release
release: push pypi
Expand Down

0 comments on commit cc87b48

Please sign in to comment.