From 43ca49c1b4ce6fd7deecb8af274f6678adf43a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 2 Dec 2023 13:56:21 +0100 Subject: [PATCH] [github] add workflow to build and push docker images heavily inspired by and adapted from https://github.com/danbooru/danbooru/blob/master/.github/workflows/docker-build.yaml --- .github/workflows/docker.yml | 61 +++++++++++++++++++++++++++++++ .github/workflows/executables.yml | 2 +- .github/workflows/tests.yml | 2 +- gallery_dl/version.py | 2 +- scripts/release.sh | 2 +- 5 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..57c1d95b --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,61 @@ +name: docker + +on: + push: + branches: + - master + tags: + - v[0-9]+.[0-9]+.[0-9]+ + +permissions: + packages: write + +jobs: + docker: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # https://github.com/docker/login-action + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # https://github.com/docker/metadata-action + - name: Generate Docker tags + uses: docker/metadata-action@v5 + id: metadata + with: + images: | + mikf123/gallery-dl + ghcr.io/mikf/gallery-dl + tags: | + type=sha,format=long,prefix= + type=ref,event=tag + # https://github.com/docker/metadata-action/issues/112 + flavor: | + latest=${{ github.ref == 'refs/heads/master' }} + + # https://github.com/docker/build-push-action + - name: Build image + uses: docker/build-push-action@v5 + with: + push: true + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} + platforms: linux/amd64 diff --git a/.github/workflows/executables.yml b/.github/workflows/executables.yml index 03251c86..f5b45672 100644 --- a/.github/workflows/executables.yml +++ b/.github/workflows/executables.yml @@ -24,7 +24,7 @@ jobs: python-packages: "toml" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }} uses: actions/setup-python@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c6dfd93..67520018 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check file permissions run: | diff --git a/gallery_dl/version.py b/gallery_dl/version.py index 5034fb23..fdf1e3ca 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -6,4 +6,4 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -__version__ = "1.26.3" +__version__ = "1.26.4-dev" diff --git a/scripts/release.sh b/scripts/release.sh index f32c796d..8b84b980 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -161,6 +161,6 @@ build-python build-linux build-windows sign -upload-git upload-pypi +upload-git update-dev