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

Improve vesioning and pip release #1095

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 14 additions & 19 deletions .github/workflows/python-pip-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ concurrency:
cancel-in-progress: true

on:
push:
branches:
- master
- improve-pip-publish

release:
types: [created]

Expand All @@ -16,30 +21,20 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and check
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |-
python -m build
twine check dist/*
- name: Test package upload
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
run: |-
twine upload --repository testpypi dist/*
- name: Package upload
pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |-
twine upload dist/*
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apt-get update \
curl \
build-essential

ENV POETRY_VERSION=1.4.0
ENV POETRY_VERSION=1.7.1
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:/usr/local/go/bin:${PATH}"
RUN python -m venv $VIRTUAL_ENV \
Expand All @@ -29,19 +29,13 @@ RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master
&& rm get_helm.sh


COPY ./MANIFEST.in ./MANIFEST.in
COPY ./pyproject.toml ./pyproject.toml
COPY ./poetry.lock ./poetry.lock
COPY ./README.md ./README.md

# Installs and caches dependencies
RUN poetry install --no-root --extras=gojsonnet

COPY ./kapitan ./kapitan

RUN pip install --editable .[test] \
&& pip install .[gojsonnet]
RUN poetry install --no-root --extras=gojsonnet

RUN --mount=type=bind,source=./,target=./ poetry install

# Final image with virtualenv built in previous step
FROM python:3.8-slim
Expand Down
2 changes: 1 addition & 1 deletion kapitan/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""Project description variables."""

PROJECT_NAME = "kapitan"
VERSION = "0.32.0"
VERSION = "0.32.1.dev146"
DESCRIPTION = "Generic templated configuration management for Kubernetes, Terraform and other things"
AUTHOR = "Ricardo Amaro"
AUTHOR_EMAIL = "[email protected]"
Expand Down
Loading
Loading