From 6d0e51ed347f0efb9e6dc9e071e9531af7ac824e Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 11:25:24 -0500 Subject: [PATCH 01/15] Initialize CI and release workflows; add version bumping scripts --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++ .github/workflows/release.yml | 61 ++++++++++++++++++++++++++++++++++ docker/build-dev.sh | 10 +++++- scripts/bump_version.py | 62 +++++++++++++++++++++++++++++++++++ scripts/increment_build.py | 33 +++++++++++++++++++ version.py | 5 +++ 6 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 scripts/bump_version.py create mode 100644 scripts/increment_build.py create mode 100644 version.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..225a46ab --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI Pipeline + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main, dev ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Update build number + run: | + python scripts/increment_build.py + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract version info + id: version + run: | + VERSION=$(python -c "import version; print(version.__version__)") + BUILD=$(python -c "import version; print(version.__build__)") + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "build=$BUILD" >> $GITHUB_OUTPUT + echo "sha_short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: | + ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ github.ref == 'refs/heads/main' && 'latest' || 'dev' }} + ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ steps.version.outputs.version }}-${{ steps.version.outputs.build }} + ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ steps.version.outputs.sha_short }} + file: ./docker/Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..8b7ca293 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Create Release + +on: + workflow_dispatch: + inputs: + version_type: + description: 'Type of version increment' + required: true + default: 'patch' + type: choice + options: + - major + - minor + - patch + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + + - name: Update Version + id: update_version + run: | + python scripts/bump_version.py ${{ github.event.inputs.version_type }} + NEW_VERSION=$(python -c "import version; print(f'{version.__version__}')") + echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + + - name: Commit and Tag + run: | + git add version.py + git commit -m "Release v${{ steps.update_version.outputs.new_version }}" + git tag -a "v${{ steps.update_version.outputs.new_version }}" -m "Release v${{ steps.update_version.outputs.new_version }}" + git push origin main --tags + + - name: Build and Push Release Image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/dispatcharr:latest + ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ steps.update_version.outputs.new_version }} + file: ./docker/Dockerfile + + - name: Create GitHub Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.update_version.outputs.new_version }} + release_name: Release v${{ steps.update_version.outputs.new_version }} + draft: false + prerelease: false diff --git a/docker/build-dev.sh b/docker/build-dev.sh index c5c79474..6dfbf0bc 100755 --- a/docker/build-dev.sh +++ b/docker/build-dev.sh @@ -1,3 +1,11 @@ #!/bin/bash -docker build --build-arg BRANCH=dev -t dispatcharr/dispatcharr:dev -f Dockerfile .. +# Get version information +VERSION=$(python -c "import sys; sys.path.append('..'); import version; print(version.__version__)") +BUILD=$(python -c "import sys; sys.path.append('..'); import version; print(version.__build__)") + +# Build with version tags +docker build --build-arg BRANCH=dev \ + -t dispatcharr/dispatcharr:dev \ + -t dispatcharr/dispatcharr:${VERSION}-${BUILD} \ + -f Dockerfile .. diff --git a/scripts/bump_version.py b/scripts/bump_version.py new file mode 100644 index 00000000..59c98117 --- /dev/null +++ b/scripts/bump_version.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +""" +Bumps the version number according to semantic versioning. +Usage: python bump_version.py [major|minor|patch] +""" +import re +import sys +from pathlib import Path + +def bump_version(version_type='patch'): + version_file = Path(__file__).parent.parent / "version.py" + content = version_file.read_text() + + # Extract version + version_match = re.search(r"__version__ = '(\d+)\.(\d+)\.(\d+)'", content) + if not version_match: + print("Could not find version number in version.py") + return + + major, minor, patch = map(int, version_match.groups()) + + # Update version based on type + if version_type == 'major': + major += 1 + minor = 0 + patch = 0 + elif version_type == 'minor': + minor += 1 + patch = 0 + else: # patch + patch += 1 + + new_version = f"{major}.{minor}.{patch}" + + # Update version in file + new_content = re.sub( + r"__version__ = '\d+\.\d+\.\d+'", + f"__version__ = '{new_version}'", + content + ) + + # Reset build number + new_content = re.sub( + r"__build__ = '\d+'", + "__build__ = '0'", + new_content + ) + + version_file.write_text(new_content) + print(f"Version bumped to {new_version}") + return new_version + +if __name__ == "__main__": + version_type = 'patch' + if len(sys.argv) > 1: + version_type = sys.argv[1].lower() + + if version_type not in ('major', 'minor', 'patch'): + print("Invalid version type. Use major, minor, or patch.") + sys.exit(1) + + bump_version(version_type) diff --git a/scripts/increment_build.py b/scripts/increment_build.py new file mode 100644 index 00000000..091a4778 --- /dev/null +++ b/scripts/increment_build.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +""" +Increments the build number in version.py +""" +import re +import os +from pathlib import Path + +def increment_build(): + version_file = Path(__file__).parent.parent / "version.py" + content = version_file.read_text() + + # Extract build number + build_match = re.search(r"__build__ = '(\d+)'", content) + if not build_match: + print("Could not find build number in version.py") + return + + build = int(build_match.group(1)) + new_build = str(build + 1) + + # Update build number + new_content = re.sub( + r"__build__ = '\d+'", + f"__build__ = '{new_build}'", + content + ) + + version_file.write_text(new_content) + print(f"Build number incremented to {new_build}") + +if __name__ == "__main__": + increment_build() diff --git a/version.py b/version.py new file mode 100644 index 00000000..c865d13b --- /dev/null +++ b/version.py @@ -0,0 +1,5 @@ +""" +Dispatcharr version information. +""" +__version__ = '0.1.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) +__build__ = '0' # Auto-incremented on builds From f3fd1602eebf5c9629d748be0d0d8c611e2ae4b6 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 11:36:02 -0500 Subject: [PATCH 02/15] Forces lowercase for github username. --- .github/workflows/ci.yml | 6 +++--- .github/workflows/release.yml | 4 ++-- docker/build-dev.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 225a46ab..0a4d4e4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: context: . push: ${{ github.event_name != 'pull_request' }} tags: | - ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ github.ref == 'refs/heads/main' && 'latest' || 'dev' }} - ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ steps.version.outputs.version }}-${{ steps.version.outputs.build }} - ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ steps.version.outputs.sha_short }} + ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:${{ github.ref == 'refs/heads/main' && 'latest' || 'dev' }} + ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:${{ steps.version.outputs.version }}-${{ steps.version.outputs.build }} + ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:${{ steps.version.outputs.sha_short }} file: ./docker/Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b7ca293..946740c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,8 +46,8 @@ jobs: context: . push: true tags: | - ghcr.io/${{ github.repository_owner }}/dispatcharr:latest - ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ steps.update_version.outputs.new_version }} + ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:latest + ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:${{ steps.update_version.outputs.new_version }} file: ./docker/Dockerfile - name: Create GitHub Release diff --git a/docker/build-dev.sh b/docker/build-dev.sh index 6dfbf0bc..a56eb3a7 100755 --- a/docker/build-dev.sh +++ b/docker/build-dev.sh @@ -1,5 +1,4 @@ #!/bin/bash - # Get version information VERSION=$(python -c "import sys; sys.path.append('..'); import version; print(version.__version__)") BUILD=$(python -c "import sys; sys.path.append('..'); import version; print(version.__build__)") @@ -9,3 +8,4 @@ docker build --build-arg BRANCH=dev \ -t dispatcharr/dispatcharr:dev \ -t dispatcharr/dispatcharr:${VERSION}-${BUILD} \ -f Dockerfile .. +. From 0e5e6f21eb9d28e094b4f5af756c68ebd9fd3c79 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 11:41:22 -0500 Subject: [PATCH 03/15] One more attempt at fixes lowercase conversion. --- .github/workflows/ci.yml | 12 +++++++++--- .github/workflows/release.yml | 10 ++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a4d4e4b..38dd5967 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,13 +35,19 @@ jobs: echo "build=$BUILD" >> $GITHUB_OUTPUT echo "sha_short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT + - name: Set lowercase repo owner + id: repo_owner + run: | + REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') + echo "lowercase=$REPO_OWNER" >> $GITHUB_OUTPUT + - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . push: ${{ github.event_name != 'pull_request' }} tags: | - ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:${{ github.ref == 'refs/heads/main' && 'latest' || 'dev' }} - ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:${{ steps.version.outputs.version }}-${{ steps.version.outputs.build }} - ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:${{ steps.version.outputs.sha_short }} + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ github.ref == 'refs/heads/main' && 'latest' || 'dev' }} + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.version.outputs.version }}-${{ steps.version.outputs.build }} + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.version.outputs.sha_short }} file: ./docker/Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 946740c4..8911b5c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,12 @@ jobs: NEW_VERSION=$(python -c "import version; print(f'{version.__version__}')") echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + - name: Set lowercase repo owner + id: repo_owner + run: | + REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') + echo "lowercase=$REPO_OWNER" >> $GITHUB_OUTPUT + - name: Commit and Tag run: | git add version.py @@ -46,8 +52,8 @@ jobs: context: . push: true tags: | - ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:latest - ghcr.io/${{ github.repository_owner != '' && github.repository_owner | lower || 'dispatcharr' }}/dispatcharr:${{ steps.update_version.outputs.new_version }} + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:latest + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.update_version.outputs.new_version }} file: ./docker/Dockerfile - name: Create GitHub Release From 8d79087fbaa244e1716fbf78f30eaae2db6ec56d Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 12:19:50 -0500 Subject: [PATCH 04/15] Adds support for branches and forks. --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++------ docker/build-dev.sh | 2 ++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38dd5967..9c462b63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,11 +35,37 @@ jobs: echo "build=$BUILD" >> $GITHUB_OUTPUT echo "sha_short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT - - name: Set lowercase repo owner - id: repo_owner + - name: Set repository and image metadata + id: meta run: | + # Get lowercase repository owner REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') - echo "lowercase=$REPO_OWNER" >> $GITHUB_OUTPUT + echo "repo_owner=$REPO_OWNER" >> $GITHUB_OUTPUT + + # Get repository name + REPO_NAME=$(echo "${{ github.repository }}" | cut -d '/' -f 2 | tr '[:upper:]' '[:lower:]') + echo "repo_name=$REPO_NAME" >> $GITHUB_OUTPUT + + # Determine branch name + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then + echo "branch_tag=latest" >> $GITHUB_OUTPUT + echo "is_main=true" >> $GITHUB_OUTPUT + elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then + echo "branch_tag=dev" >> $GITHUB_OUTPUT + echo "is_main=false" >> $GITHUB_OUTPUT + else + # For other branches, use the branch name + BRANCH=$(echo "${{ github.ref }}" | sed 's/refs\/heads\///' | sed 's/[^a-zA-Z0-9]/-/g') + echo "branch_tag=$BRANCH" >> $GITHUB_OUTPUT + echo "is_main=false" >> $GITHUB_OUTPUT + fi + + # Determine if this is from a fork + if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then + echo "is_fork=true" >> $GITHUB_OUTPUT + else + echo "is_fork=false" >> $GITHUB_OUTPUT + fi - name: Build and push Docker image uses: docker/build-push-action@v4 @@ -47,7 +73,10 @@ jobs: context: . push: ${{ github.event_name != 'pull_request' }} tags: | - ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ github.ref == 'refs/heads/main' && 'latest' || 'dev' }} - ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.version.outputs.version }}-${{ steps.version.outputs.build }} - ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.version.outputs.sha_short }} + ghcr.io/${{ steps.meta.outputs.repo_owner }}/${{ steps.meta.outputs.repo_name }}:${{ steps.meta.outputs.branch_tag }} + ghcr.io/${{ steps.meta.outputs.repo_owner }}/${{ steps.meta.outputs.repo_name }}:${{ steps.version.outputs.version }}-${{ steps.version.outputs.build }} + ghcr.io/${{ steps.meta.outputs.repo_owner }}/${{ steps.meta.outputs.repo_name }}:${{ steps.version.outputs.sha_short }} + build-args: | + BRANCH=${{ github.ref_name }} + REPO_URL=https://github.com/${{ github.repository }} file: ./docker/Dockerfile diff --git a/docker/build-dev.sh b/docker/build-dev.sh index a56eb3a7..65d643a7 100755 --- a/docker/build-dev.sh +++ b/docker/build-dev.sh @@ -1,4 +1,6 @@ #!/bin/bash +docker build --build-arg BRANCH=dev -t dispatcharr/dispatcharr:dev -f Dockerfile .. + # Get version information VERSION=$(python -c "import sys; sys.path.append('..'); import version; print(version.__version__)") BUILD=$(python -c "import sys; sys.path.append('..'); import version; print(version.__build__)") From eecff6a197fef39e8c245fc8ffd903c70335b561 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Apr 2025 18:09:45 +0000 Subject: [PATCH 05/15] Release v0.1.1 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index c865d13b..533fa590 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ """ Dispatcharr version information. """ -__version__ = '0.1.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) +__version__ = '0.1.1' # Follow semantic versioning (MAJOR.MINOR.PATCH) __build__ = '0' # Auto-incremented on builds From 10f687acb13d8be01b9cee312ed0d80bffe31816 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 13:23:24 -0500 Subject: [PATCH 06/15] Updated permissions for releases. --- .github/workflows/ci.yml | 5 +++++ .github/workflows/release.yml | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c462b63..19fb7891 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,11 @@ on: pull_request: branches: [ main, dev ] +# Add explicit permissions for the workflow +permissions: + contents: read + packages: write # For publishing to GitHub Container Registry + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8911b5c8..c03cc318 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,11 @@ on: - minor - patch +# Add explicit permissions for the workflow +permissions: + contents: write # For managing releases and pushing tags + packages: write # For publishing to GitHub Container Registry + jobs: release: runs-on: ubuntu-latest @@ -39,6 +44,13 @@ jobs: REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') echo "lowercase=$REPO_OWNER" >> $GITHUB_OUTPUT + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Commit and Tag run: | git add version.py From a02c37f844dce5b0f88bf7fbf9bceb9dafb28382 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Apr 2025 18:32:38 +0000 Subject: [PATCH 07/15] Release v0.1.2 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index 533fa590..5bcf356a 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ """ Dispatcharr version information. """ -__version__ = '0.1.1' # Follow semantic versioning (MAJOR.MINOR.PATCH) +__version__ = '0.1.2' # Follow semantic versioning (MAJOR.MINOR.PATCH) __build__ = '0' # Auto-incremented on builds From 38e3c437bc41158058be017ea680c21c0cca37d5 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 13:55:29 -0500 Subject: [PATCH 08/15] Enhance CI and release workflows with multi-architecture support and build optimizations --- .github/workflows/ci.yml | 1 + .github/workflows/release.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19fb7891..9e75d91b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,7 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} + platforms: linux/amd64 # Fast build - amd64 only tags: | ghcr.io/${{ steps.meta.outputs.repo_owner }}/${{ steps.meta.outputs.repo_name }}:${{ steps.meta.outputs.branch_tag }} ghcr.io/${{ steps.meta.outputs.repo_owner }}/${{ steps.meta.outputs.repo_name }}:${{ steps.version.outputs.version }}-${{ steps.version.outputs.build }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c03cc318..12b9cbaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,6 +44,12 @@ jobs: REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') echo "lowercase=$REPO_OWNER" >> $GITHUB_OUTPUT + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -63,9 +69,13 @@ jobs: with: context: . push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 # Multi-arch support for releases tags: | ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:latest ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.update_version.outputs.new_version }} + build-args: | + BRANCH=main # Always use main branch for releases + REPO_URL=https://github.com/${{ github.repository }} file: ./docker/Dockerfile - name: Create GitHub Release From 5eb8b28fb27fc6ccd825256fe9d0b28985bda3a5 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Apr 2025 19:02:16 +0000 Subject: [PATCH 09/15] Release v0.2.0 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index 5bcf356a..b4b893b7 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ """ Dispatcharr version information. """ -__version__ = '0.1.2' # Follow semantic versioning (MAJOR.MINOR.PATCH) +__version__ = '0.2.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) __build__ = '0' # Auto-incremented on builds From 51ca24a6f7f55a42695d7e19e53950d6b08a6bd9 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 14:09:06 -0500 Subject: [PATCH 10/15] Use branch that is being ran from. --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12b9cbaa..829f4a38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,12 +69,12 @@ jobs: with: context: . push: true - platforms: linux/amd64,linux/arm64,linux/arm/v7 # Multi-arch support for releases + platforms: linux/amd64,linux/arm64 #,linux/arm/v7 # Multi-arch support for releases tags: | ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:latest ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.update_version.outputs.new_version }} build-args: | - BRANCH=main # Always use main branch for releases + BRANCH=${{ github.ref_name }} REPO_URL=https://github.com/${{ github.repository }} file: ./docker/Dockerfile From a3110b53aef3778cb277639736abcc9b349a181f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Apr 2025 19:10:06 +0000 Subject: [PATCH 11/15] Release v0.3.0 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index b4b893b7..a79f52bd 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ """ Dispatcharr version information. """ -__version__ = '0.2.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) +__version__ = '0.3.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) __build__ = '0' # Auto-incremented on builds From a7f3ebfd838f33c24ad71f7b282464fe3ac5ab10 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 14:45:07 -0500 Subject: [PATCH 12/15] Refactor output variable assignments in CI and release workflows for consistency --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/release.yml | 11 +++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e75d91b..612c8b86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,8 @@ jobs: run: | VERSION=$(python -c "import version; print(version.__version__)") BUILD=$(python -c "import version; print(version.__build__)") - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "build=$BUILD" >> $GITHUB_OUTPUT + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "build=${BUILD}" >> $GITHUB_OUTPUT echo "sha_short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT - name: Set repository and image metadata @@ -45,11 +45,11 @@ jobs: run: | # Get lowercase repository owner REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') - echo "repo_owner=$REPO_OWNER" >> $GITHUB_OUTPUT + echo "repo_owner=${REPO_OWNER}" >> $GITHUB_OUTPUT # Get repository name REPO_NAME=$(echo "${{ github.repository }}" | cut -d '/' -f 2 | tr '[:upper:]' '[:lower:]') - echo "repo_name=$REPO_NAME" >> $GITHUB_OUTPUT + echo "repo_name=${REPO_NAME}" >> $GITHUB_OUTPUT # Determine branch name if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then @@ -61,7 +61,7 @@ jobs: else # For other branches, use the branch name BRANCH=$(echo "${{ github.ref }}" | sed 's/refs\/heads\///' | sed 's/[^a-zA-Z0-9]/-/g') - echo "branch_tag=$BRANCH" >> $GITHUB_OUTPUT + echo "branch_tag=${BRANCH}" >> $GITHUB_OUTPUT echo "is_main=false" >> $GITHUB_OUTPUT fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 829f4a38..db384065 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,13 +36,13 @@ jobs: run: | python scripts/bump_version.py ${{ github.event.inputs.version_type }} NEW_VERSION=$(python -c "import version; print(f'{version.__version__}')") - echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT - name: Set lowercase repo owner id: repo_owner run: | REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') - echo "lowercase=$REPO_OWNER" >> $GITHUB_OUTPUT + echo "lowercase=${REPO_OWNER}" >> $GITHUB_OUTPUT - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -79,11 +79,10 @@ jobs: file: ./docker/Dockerfile - name: Create GitHub Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: tag_name: v${{ steps.update_version.outputs.new_version }} - release_name: Release v${{ steps.update_version.outputs.new_version }} + name: Release v${{ steps.update_version.outputs.new_version }} draft: false prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} From a5dab8839e4b24eb007be54b9f9aa04cd0664d0b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 10 Apr 2025 19:50:20 +0000 Subject: [PATCH 13/15] Release v0.4.0 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index a79f52bd..f331ede6 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ """ Dispatcharr version information. """ -__version__ = '0.3.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) +__version__ = '0.4.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) __build__ = '0' # Auto-incremented on builds From 963eef9a2902114bf39bf9243b473edd5d6dd8cb Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 15:37:05 -0500 Subject: [PATCH 14/15] Add latest-arm64 tag --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db384065..6fb7187b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,10 +69,15 @@ jobs: with: context: . push: true - platforms: linux/amd64,linux/arm64 #,linux/arm/v7 # Multi-arch support for releases + platforms: linux/amd64,linux/arm64, #linux/arm/v7 # Multi-arch support for releases tags: | ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:latest ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.update_version.outputs.new_version }} + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:latest-amd64 + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:latest-arm64 + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.update_version.outputs.new_version }}-amd64 + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.update_version.outputs.new_version }}-arm64 + ghcr.io/${{ steps.repo_owner.outputs.lowercase }}/dispatcharr:${{ steps.update_version.outputs.new_version }}-armv7 build-args: | BRANCH=${{ github.ref_name }} REPO_URL=https://github.com/${{ github.repository }} From 34a384e66c4e0d284fef3d7abf3addeba5177070 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 15:52:37 -0500 Subject: [PATCH 15/15] Reset version to 0.1.0 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index f331ede6..c865d13b 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ """ Dispatcharr version information. """ -__version__ = '0.4.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) +__version__ = '0.1.0' # Follow semantic versioning (MAJOR.MINOR.PATCH) __build__ = '0' # Auto-incremented on builds