Skip to content

Commit

Permalink
Moved from manifest to buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed May 2, 2024
1 parent 43e3157 commit 8a7ed3e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 65 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@ jobs:
build-docker-and-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Installing dependencies
run: |
sudo apt update && sudo apt install make -y
git clone https://github.com/estesp/manifest-tool && cd manifest-tool && git checkout v0.9.0 && sudo make && sudo make install && cd .. && rm -Rf manifest-tool
docker run --rm --privileged multiarch/qemu-user-static:register
sudo apt install -y qemu qemu-user-static qemu-user binfmt-support
echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_LOGIN }}" --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
sudo apt update && sudo apt install make python3-pip python3-setuptools -y
pip3 install twine
- name: install buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
- name: Build package
run: make install
- name: Publish package
run: python3 -m twine upload dist/* -u "${{ secrets.PYPI_USERNAME }}" -p "${{ secrets.PYPI_PASSWORD }}"
- name: Build image
run: make build-docker
- name: Publish image
run: make publish-docker latest
run: make publish-docker
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
/dist
/youtube_music_uploader.egg-info
/youtube_music_uploader/__pycache__
.Dockerfile
*.yaml
qemu-*-static
32 changes: 8 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
.PHONY: all test publish install clean check build-docker publish-docker latest
.PHONY: all test publish install clean check build-docker publish-docker

VERSION ?= 1.2.0
CACHE ?= --no-cache=1
FULLVERSION ?= 1.1.0
archs ?= amd64 i386 arm64v8 arm32v6
all: build-docker publish-docker latest
qemu-arm-static:
cp /usr/bin/qemu-arm-static .
qemu-aarch64-static:
cp /usr/bin/qemu-aarch64-static .
build-docker: qemu-arm-static qemu-aarch64-static
$(foreach arch,$(archs), \
cat docker/Dockerfile | sed "s/FROM python:alpine/FROM ${arch}\/python:alpine/g" > .Dockerfile; \
docker build -t ghcr.io/jaymoulin/youtube-music-uploader:${VERSION}-$(arch) -t jaymoulin/youtube-music-uploader:${VERSION}-$(arch) -f .Dockerfile --build-arg VERSION=${VERSION} ${CACHE} .;\
)

all: build-docker publish-docker
build-docker:
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 ${PUSH} --build-arg VERSION=${VERSION} --tag jaymoulin/youtube-music-uploader --tag jaymoulin/youtube-music-uploader:${VERSION} ${CACHE} -f ./docker/Dockerfile .
publish-docker:
docker push jaymoulin/youtube-music-uploader -a
docker push ghcr.io/jaymoulin/youtube-music-uploader -a
cat docker/manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest.yaml
cat manifest.yaml | sed "s/\$$FULLVERSION/${FULLVERSION}/g" > manifest2.yaml
mv manifest2.yaml manifest.yaml
manifest-tool push from-spec manifest.yaml
cat manifest.yaml | sed "s/jaymoulin/ghcr.io\/jaymoulin/g" > manifest2.yaml
mv manifest2.yaml manifest.yaml
manifest-tool push from-spec manifest.yaml
latest:
FULLVERSION=latest VERSION=${VERSION} make publish-docker
PUSH=--push CACHE= make build-docker


test: install
twine upload -r testpypi dist/*
publish: install
Expand Down
11 changes: 4 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM python:alpine as builder

COPY qemu-*-static /usr/bin/

FROM builder
FROM python:alpine

ARG VERSION=1.3.1
ARG TARGETPLATFORM

LABEL maintainer="Jay MOULIN <https://jaymoulin.me/me/youtube-music-uploader/> <https://twitter.com/MoulinJay>"
LABEL version=${VERSION}
LABEL maintainer="Jay MOULIN <https://jaymoulin.me/me/youtube-music-uploader/>"
LABEL version=${VERSION}-${TARGETPLATFORM}

ENV REMOVE=0
ENV ONESHOT=0
Expand Down
8 changes: 6 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
> [!CAUTION]
> As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support my work.
> [!NOTE]
> (This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added.)
![logo](../logo.png)

Youtube Music Uploader - Docker Image
Expand All @@ -9,8 +15,6 @@ Youtube Music Uploader - Docker Image
[![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png "Buy me a coffee")](https://www.buymeacoffee.com/jaymoulin)
[![Buy me a coffee](https://ko-fi.com/img/githubbutton_sm.svg "Buy me a coffee")](https://www.ko-fi.com/jaymoulin)

(This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added.)

This image allows you to watch a folder and upload all new MP3 added to your Youtube Music Library.

Installation
Expand Down
23 changes: 0 additions & 23 deletions docker/manifest.yml

This file was deleted.

0 comments on commit 8a7ed3e

Please sign in to comment.