forked from weblyzard/inscriptis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.sh
executable file
·37 lines (30 loc) · 1.03 KB
/
publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Publishing sequence:
# ====================
# 1. create pypi package
# 2. publish docker container
# 3. create github release (which runs the helm scripts)
# publish the latest package to pypi
# sources:
# - https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project
# - https://packaging.python.org/guides/making-a-pypi-friendly-readme/
VERSION=$(grep -oP '^version = "\K[^"]+' pyproject.toml)
IMAGE_NAME=inscriptis
case "$1" in
python)
# cleanup dist
rm -rf ./dist
# build and publish packages
poetry publish --build
;;
docker)
echo "Publishing ${IMAGE_NAME} in version ${VERSION}"
docker login ghcr.io -u AlbertWeichselbraun --password-stdin < ../github-token.txt
docker build -t ${IMAGE_NAME}:${VERSION} .
# Step 2: Tag
docker tag ${IMAGE_NAME}:${VERSION} ghcr.io/weblyzard/${IMAGE_NAME}:${VERSION}
docker tag ${IMAGE_NAME}:${VERSION} ghcr.io/weblyzard/${IMAGE_NAME}:latest
# Step 3: Publish
docker push ghcr.io/weblyzard/${IMAGE_NAME}:${VERSION}
;;
esac