Skip to content

Commit

Permalink
feat: create version bumping in ci (tag based)
Browse files Browse the repository at this point in the history
  • Loading branch information
longstone committed Jan 24, 2024
1 parent cbd0524 commit 1d0a9f3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions .VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
latest-dev
6 changes: 6 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Update version file ⬆️
uses: brettdorrans/[email protected]
with:
filename: 'setup.py'
placeholder: 'latest-dev'

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Update version file ⬆️
uses: brettdorrans/[email protected]
with:
filename: 'setup.py'
placeholder: 'latest-dev'

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
Expand All @@ -43,7 +49,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
- name: Build and push Docker image 📦 to ghcr
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ RUN apk add --no-cache --virtual .build-deps \
apk add --no-cache libxslt libxml2

RUN mkdir -p /src
COPY . /src
COPY ./withings_sync /src
COPY ./setup.py /src
COPY ./.VERSION /src

RUN cd /src && \
python3 ./setup.py install
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,17 @@ This will run the job every 3 hours (at a random minute) and writing the output

Release works via the GitHub [Draft a new Release](https://github.com/jaroslawhartman/withings-sync/releases/new)
function.
Keep in mind to bump the `version` key in `setup.py`.
The `version` key in `setup.py` will be bumped automatically (Version will be written to .VERSION file).


### Docker Image

An image is created magically by GitHub Action and published
to [ghcr](https://github.com/jaroslawhartman/withings-sync/pkgs/container/withings-sync).

### pypi
### Manual release: pypi

Will be conducted automatically within the Github-Release cycle.
You'll find a script to create and upload a release to pypi here `contrib/do_release.sh`.
It requires [twine](https://pypi.org/project/twine/).
This needs the permission on the [pypi-project](https://pypi.org/project/withings-sync/).
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def read(fname):

setup(
name="withings-sync",
version="4.2.4",
version=read(".VERSION"),
author="Masayuki Hamasaki, Steffen Vogel",
author_email="[email protected]",
description="A tool for synchronisation of Withings (ex. Nokia Health Body) to Garmin Connect and Trainer Road.",
Expand Down

0 comments on commit 1d0a9f3

Please sign in to comment.