Skip to content

Commit

Permalink
Merge pull request #163 from jaroslawhartman/feat/bypass-manual-versi…
Browse files Browse the repository at this point in the history
…on-bumping

feat: create version bumping in ci (tag based)
  • Loading branch information
longstone authored Aug 20, 2024
2 parents d01a6d5 + c158d40 commit 3863629
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions .VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${VERSION}
5 changes: 5 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:

steps:
- uses: actions/checkout@master
- name: Update version file ⬆️
uses: brettdorrans/write-version-to-file@v1.1.0
with:
filename: '.VERSION'
placeholder: '${VERSION}'

- name: Set up Python 3.10
uses: actions/setup-python@v3
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/write-version-to-file@v1.1.0
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).
Keep in mind to update the `.VERSION` if a major release is done.

### 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.5",
version=read(".VERSION"),
author="Masayuki Hamasaki, Steffen Vogel",
author_email="post@steffenvogel.de",
description="A tool for synchronisation of Withings (ex. Nokia Health Body) to Garmin Connect and Trainer Road.",
Expand Down

0 comments on commit 3863629

Please sign in to comment.