From 3df14445bed18941a9f237a5387ff366a640369e Mon Sep 17 00:00:00 2001 From: lAmeR1 <42315864+lAmeR1@users.noreply.github.com> Date: Wed, 8 Feb 2023 22:02:09 +0100 Subject: [PATCH 1/3] write version to file --- .github/workflows/docker-image.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8adfa59..97295ae 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,6 +12,11 @@ jobs: runs-on: ubuntu-latest steps: + - name: Create File + uses: finnp/create-file-action@1.0.0 + env: + FILE_NAME: "VERSION" + FILE_DATA: ${{github.ref_name}} - name: Checkout uses: actions/checkout@v3 From c095f4807f038b6eec207229c0b0422b9a64a771 Mon Sep 17 00:00:00 2001 From: lAmeR1 <42315864+lAmeR1@users.noreply.github.com> Date: Wed, 8 Feb 2023 22:05:36 +0100 Subject: [PATCH 2/3] Versioning fix (#12) * release version as env variable * versioning via file --- server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 7675585..ab08036 100644 --- a/server.py +++ b/server.py @@ -15,10 +15,17 @@ sio = socketio.AsyncServer(async_mode="asgi", cors_allowed_origins=[]) socket_app = socketio.ASGIApp(sio) +try: + with open("VERSION", "r") as f: + release_version = f.read() +except FileNotFoundError: + release_version = "x.x.x" + + app = FastAPI( title="Kaspa REST-API server", description="This server is to communicate with kaspa network via REST-API", - version="0.0.2", + version=release_version, contact={ "name": "lAmeR1" }, From 9bd6636032ce2c536e37cc7ee2416790920ac287 Mon Sep 17 00:00:00 2001 From: lAmeR1 <42315864+lAmeR1@users.noreply.github.com> Date: Wed, 8 Feb 2023 22:48:06 +0100 Subject: [PATCH 3/3] Update docker-image.yml --- .github/workflows/docker-image.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 97295ae..39ca4fa 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,11 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Create File - uses: finnp/create-file-action@1.0.0 - env: - FILE_NAME: "VERSION" - FILE_DATA: ${{github.ref_name}} - name: Checkout uses: actions/checkout@v3 @@ -34,3 +29,5 @@ jobs: push: true tags: lamer1/kaspa-rest-wallet:${{github.ref_name}}, lamer1/kaspa-rest-wallet:latest file: ./docker/Dockerfile + build-args: | + version=${{github.ref_name}}