diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..3cc2cbc --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,32 @@ +name: Docker Build and Test + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: false + tags: datmanslo/catt:latest + load: true + + - name: Test Docker image + run: | + docker run --rm --name catt datmanslo/catt:latest --version | grep -c "catt v0.13.0, Zaniest Zapper." || exit 1 + diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index e8717c4..b0f2ddd 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -26,7 +26,7 @@ jobs: run: echo ${{ steps.buildx.outputs.platforms }} - name: login to docker hub - run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - name: build the image run: | diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 60d9757..14c8ab2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,12 @@ jobs: uses: actions/checkout@v2 - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + COMMIT_MSG=$(git log -1 --pretty=%B) + echo "COMMIT_MESSAGE<> $GITHUB_ENV + echo "$COMMIT_MSG" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -53,8 +58,6 @@ jobs: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} - body: | - Changes in this Release - - Updated to CATT v0.12.0 + body: ${{ env.COMMIT_MESSAGE }} draft: false prerelease: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 61f9510..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: minimal - -services: - - docker - -install: - - docker build -t datmanslo/catt . - -script: - - docker run --rm --name catt datmanslo/catt --version | grep -c "catt v0.12.0, Zaniest Zapper." || travis_terminate 1 diff --git a/Dockerfile b/Dockerfile index 54a59e8..d847f33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,18 @@ ARG BASE_OS="alpine" -ARG BASE_OS_VERSION="3" +ARG BASE_OS_VERSION="3.22" FROM ${BASE_OS}:${BASE_OS_VERSION} -ARG CATT_VERSION=0.12.0 +ARG CATT_VERSION=0.13.0 +ENV CATT_VERSION=${CATT_VERSION} LABEL maintainer="datmanslo@yahoo.com" \ - version="{CATT_VERSION}" \ + version="${CATT_VERSION}" \ repo="github.com/datmanslo/docker-catt" RUN apk add --no-cache python3 py3-pip && \ - pip3 install catt==${CATT_VERSION} && \ - rm -rf /root/.cache/pip + pip3 install --no-cache-dir --break-system-packages catt==${CATT_VERSION} && \ + find /usr/lib/python3* -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true && \ + rm -rf /root/.cache ENTRYPOINT ["catt"] diff --git a/README.md b/README.md index b0b0e83..464b311 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.com/datmanslo/docker-catt.svg?branch=main)](https://travis-ci.com/datmanslo/docker-catt) +[![Docker Build and Test](https://github.com/datmanslo/docker-catt/actions/workflows/docker-build.yml/badge.svg)](https://github.com/datmanslo/docker-catt/actions/workflows/docker-build.yml) # docker-catt "Dockerized" version of https://github.com/skorokithakis/catt: Cast All The Things ## Usage: