From ae14c496774d88ab055f889c48a4cfa28f8cb9cb Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 15 Apr 2025 10:35:02 +0100 Subject: [PATCH] Cleanup and configure for Github building --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ .github/renovate.json | 5 +++ .github/workflows/build-container.yaml | 33 ++++++++++++++++++++ README.md | 9 ++---- buildspec-manifest.yml | 35 --------------------- buildspec.yml | 26 ---------------- docker-compose.yml | 15 --------- version.txt | 1 - 9 files changed, 98 insertions(+), 84 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/renovate.json create mode 100644 .github/workflows/build-container.yaml delete mode 100644 buildspec-manifest.yml delete mode 100644 buildspec.yml delete mode 100644 docker-compose.yml delete mode 100644 version.txt diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..1ded03d --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "config:base" + ] +} \ No newline at end of file diff --git a/.github/workflows/build-container.yaml b/.github/workflows/build-container.yaml new file mode 100644 index 0000000..4d4ffc4 --- /dev/null +++ b/.github/workflows/build-container.yaml @@ -0,0 +1,33 @@ +name: Build Container + +"on": + push: + branches: + - main + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GHCR + uses: docker/login-action@v3 + if: github.event_name != 'pull_request' + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + id: docker_build + uses: docker/build-push-action@v6 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: | + ghcr.io/${{ github.repository_owner }}/cups-avahi-airprint:${{ github.ref_name }} + ghcr.io/${{ github.repository_owner }}/cups-avahi-airprint:latest diff --git a/README.md b/README.md index 89bfc0e..e03ef5f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,6 @@ -# chuckcharlie/cups-avahi-airprint +# cups-avahi-airprint -Fork from [quadportnick/docker-cups-airprint](https://github.com/quadportnick/docker-cups-airprint) - -### Now supports ARM64 and AMD64! -Use the *latest* or *version#* tags to auto choose the right architecture. - -This Alpine-based Docker image runs a CUPS instance that is meant as an AirPrint relay for printers that are already on the network but not AirPrint capable. The other images out there never seemed to work right. I forked the original to use Alpine instead of Ubuntu and work on more host OS's. +Fork from [chuckcharlie/cups-avahi-airprint](), which was a fork of [quadportnick/docker-cups-airprint](https://github.com/quadportnick/docker-cups-airprint) ## Configuration diff --git a/buildspec-manifest.yml b/buildspec-manifest.yml deleted file mode 100644 index 8077aaa..0000000 --- a/buildspec-manifest.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: 0.2 -#Buildspec file for AWS Codebuild -#Generates multi-arch manifest - -env: - secrets-manager: - DOCKERHUB_PASS: "/dockerhub/credentials:password" - DOCKERHUB_USERNAME: "/dockerhub/credentials:username" -phases: - install: - commands: - - yum update -y - pre_build: - commands: - - echo Logging in to DOCKER... - - docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASS - build: - commands: - - echo Build started on `date` - - echo Building the Docker manifest... - - VERSION=$(cat version.txt) - - export DOCKER_CLI_EXPERIMENTAL=enabled - - docker manifest create $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-amd64 - - docker manifest annotate --arch arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-arm64 - - docker manifest annotate --arch amd64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-amd64 - - docker manifest create $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:latest $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-amd64 - - docker manifest annotate --arch arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-arm64 - - docker manifest annotate --arch amd64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-amd64 - - post_build: - commands: - - echo Build completed on `date` - - echo Pushing the Docker image... - - docker manifest push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION - - docker manifest push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:latest diff --git a/buildspec.yml b/buildspec.yml deleted file mode 100644 index 55d63cf..0000000 --- a/buildspec.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 0.2 -#Generic buildspec file for AWS Codebuild -#Works for both ARM and AMD builds -env: - secrets-manager: - DOCKERHUB_PASS: "/dockerhub/credentials:password" - DOCKERHUB_USERNAME: "/dockerhub/credentials:username" -phases: - install: - commands: - - yum update -y - pre_build: - commands: - - echo Logging in to DOCKER... - - docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASS - build: - commands: - - echo Build started on `date` - - echo Building the Docker image... - - VERSION=$(cat version.txt) - - docker build -t $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-$ARCH -t $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$IMAGE_TAG-$ARCH . - post_build: - commands: - - echo Build completed on `date` - - echo Pushing the Docker image... - - docker push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME --all-tags diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index dfc51f3..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: '3.5' - -services: - cups: - container_name: cups - image: chuckcharlie/cups-avahi-airprint - #build: . - restart: always - network_mode: "host" - environment: - CUPSADMIN: cups - CUPSPASSWORD: cups - volumes: - - "./services:/services" - - "./config:/config" diff --git a/version.txt b/version.txt deleted file mode 100644 index 6085e94..0000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.2.1