From 9380d92af8820ecc975c61c53bbaa7b0a2aac260 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Fri, 12 Sep 2025 23:36:48 +0300 Subject: [PATCH] fix version tagging --- .github/workflows/build-pr.yml | 4 +-- .github/workflows/delete-builds.yml | 2 +- .github/workflows/main.yml | 47 +++++++++++++++-------------- .github/workflows/native-build.yml | 2 +- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 366e23a0..35bc2665 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -1,4 +1,4 @@ -name: Test PR +name: build-pr permissions: contents: read @@ -14,7 +14,7 @@ on: env: PNPM_VERSION: 10 NODE_VERSION: 20 - PYTHON_VERSION: "3.11" + PYTHON_VERSION: "3.13" jobs: test: diff --git a/.github/workflows/delete-builds.yml b/.github/workflows/delete-builds.yml index c835a0d9..3584fb71 100644 --- a/.github/workflows/delete-builds.yml +++ b/.github/workflows/delete-builds.yml @@ -1,4 +1,4 @@ -name: delete builds +name: delete-builds on: workflow_dispatch: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05a5a1cf..b452f595 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Build Docker Containers +name: build-docker-containers on: workflow_dispatch: @@ -26,7 +26,7 @@ env: GHCR_SLUG: ghcr.io/arabcoders/ytptube PNPM_VERSION: 10 NODE_VERSION: 20 - PYTHON_VERSION: "3.11" + PYTHON_VERSION: "3.13" jobs: test: @@ -107,7 +107,6 @@ jobs: working-directory: ui run: pnpm run generate - # Generate changelog and version files - name: Install GitPython run: pip install gitpython @@ -115,26 +114,6 @@ jobs: run: | python3 .github/scripts/generate_changelog.py -p . -f ./ui/exported/CHANGELOG.json - - name: Update app/library/version.py - run: | - VERSION="${GITHUB_REF##*/}" - SHA=$(git rev-parse HEAD) - DATE=$(date -u +"%Y%m%d") - BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/\//-/g') - - echo "APP_VERSION=${VERSION}" >> "$GITHUB_ENV" - echo "APP_SHA=${SHA}" >> "$GITHUB_ENV" - echo "APP_DATE=${DATE}" >> "$GITHUB_ENV" - echo "APP_BRANCH=${BRANCH}" >> "$GITHUB_ENV" - - sed -i \ - -e "s/^APP_VERSION = \".*\"/APP_VERSION = \"${VERSION}\"/" \ - -e "s/^APP_COMMIT_SHA = \".*\"/APP_COMMIT_SHA = \"${SHA}\"/" \ - -e "s/^APP_BUILD_DATE = \".*\"/APP_BUILD_DATE = \"${DATE}\"/" \ - -e "s/^APP_BRANCH = \".*\"/APP_BRANCH = \"${BRANCH}\"/" \ - app/library/version.py - - # Upload built frontend as artifact for docker builds - name: Upload frontend build uses: actions/upload-artifact@v4 with: @@ -170,6 +149,28 @@ jobs: name: frontend-build path: ui/exported/ + - name: Update app/library/version.py + run: | + VERSION="${GITHUB_REF##*/}" + SHA=$(git rev-parse HEAD) + DATE=$(date -u +"%Y%m%d") + BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/\//-/g') + + echo "APP_VERSION=${VERSION}" >> "$GITHUB_ENV" + echo "APP_SHA=${SHA}" >> "$GITHUB_ENV" + echo "APP_DATE=${DATE}" >> "$GITHUB_ENV" + echo "APP_BRANCH=${BRANCH}" >> "$GITHUB_ENV" + + sed -i \ + -e "s/^APP_VERSION = \".*\"/APP_VERSION = \"${VERSION}\"/" \ + -e "s/^APP_COMMIT_SHA = \".*\"/APP_COMMIT_SHA = \"${SHA}\"/" \ + -e "s/^APP_BUILD_DATE = \".*\"/APP_BUILD_DATE = \"${DATE}\"/" \ + -e "s/^APP_BRANCH = \".*\"/APP_BRANCH = \"${BRANCH}\"/" \ + app/library/version.py + + echo "Updated version info:" + cat app/library/version.py + - name: Docker meta id: meta uses: docker/metadata-action@v5 diff --git a/.github/workflows/native-build.yml b/.github/workflows/native-build.yml index 9fe85274..d630119b 100644 --- a/.github/workflows/native-build.yml +++ b/.github/workflows/native-build.yml @@ -1,4 +1,4 @@ -name: Build Native wrappers +name: native-build on: workflow_dispatch: