From fb37e449e438f67f513c04dee246b46082de6f88 Mon Sep 17 00:00:00 2001 From: jbaranec Date: Fri, 7 Feb 2025 08:01:35 +0100 Subject: [PATCH] update version from tag, upload config.json to ftp --- .github/workflows/docker-publish.yml | 9 +++++++-- config.json | 6 ++---- update_version.sh | 4 +++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e63e3b9..2dd47ae 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,8 +2,8 @@ name: Build and Publish Docker Image on: push: - branches: - - master + # branches: + # - master tags: - 'v*.*.*' # Matches version tags like v1.0.0 workflow_dispatch: @@ -82,3 +82,8 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} repository: ${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }} + + - name: Upload to FTP + run: | + curl -T config.json ftp.pdfix.net/update-service/v1/actions/${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }}/config.json --user "${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}" --ftp-create-dirs + \ No newline at end of file diff --git a/config.json b/config.json index 035428c..0d45b7d 100644 --- a/config.json +++ b/config.json @@ -1,14 +1,12 @@ { + "version": "v0.0.0", "actions": [ { "title": "OCR Tesseract", "name": "ocr_tesseract", "desc": "A Docker image that adds an OCR text layer to scanned PDF files using PDFix SDK and Tesseract OCR", "icon": "image_search", - "version": { - "major": 1, - "minor": 0 - }, + "version": "v0.0.0", "category": "OCR", "program": "docker run --platform linux/amd64 -v \"${working_directory}:/data\" --rm pdfix/ocr-tesseract:latest --name \"${license_name}\" --key \"${license_key}\" ocr -i \"/data/${input_pdf}\" -o \"/data/${output_pdf}\" --lang \"${language}\"", "args": [ diff --git a/update_version.sh b/update_version.sh index a957e09..f6a4fb4 100644 --- a/update_version.sh +++ b/update_version.sh @@ -18,7 +18,9 @@ if [ ! -f "config.json" ]; then exit 1 fi +# Replace "v0.0.0" placeholder with the provided argument in config.json +sed -i "s|v0.0.0|$1|g" config.json # Replace "latest" with the provided argument in config.json -sed -i "s/latest/$1/g" config.json +sed -i "s|latest|$1|g" config.json echo "Replaced all occurrences of 'latest' with '$1' in config.json."