diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07d3af5871d86928bd7f7024483f56113115e2d7..4be1cfe048bf1ee528006997c67698300fd076eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - test + - build variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" @@ -17,3 +18,47 @@ test: - pytest tags: - docker + +build-linux: + stage: build + image: python:3.6 + before_script: + - pip install .[dev] + script: + - pyinstaller --clean -y cli.spec --distpath . + - echo "Testing the generated CLI works…" && ./funkwhale --help && echo "funkwhale CLI working \o/" + artifacts: + name: "linux_${CI_COMMIT_REF_NAME}" + paths: + - funkwhale + only: + - tags@funkwhale/cli + - master@funkwhale/cli + + tags: + - docker + +build-windows: + # there is a weird Gitlab / windows interaction + # cf https://github.com/cdrx/docker-pyinstaller/issues/38 + # so we cannot use the regular docker executor + stage: build + image: docker:stable + tags: + - docker-build + + variables: + # CI_DEBUG_TRACE: "true" + script: + - docker run --rm -v "$(pwd):/src/" cdrx/pyinstaller-windows:python3 "pip install -r requirements-dev.txt && pyinstaller --clean -y cli.spec --distpath ." + - docker run --rm -v "$(pwd):/src/" cdrx/pyinstaller-windows:python3 "echo 'Testing the generated CLI works…' && wine ./funkwhale.exe --help && echo 'funkwhale CLI working \o/'" + artifacts: + name: "linux_${CI_COMMIT_REF_NAME}" + paths: + - funkwhale.exe + only: + - tags@funkwhale/cli + - master@funkwhale/cli + + tags: + - docker-build diff --git a/README.md b/README.md index cd6ce4e011e1cde40a4c79c5c6d08889b23e1514..ff6fb206aeb0a626b9a1216aa516a4e5de499e3b 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,33 @@ A command line interface to interact with Funkwhale servers. # Installation +We provide some prebuilt binaries for Windows and Linux. + +On Linux: + +``` +curl -L "https://dev.funkwhale.audio/funkwhale/cli/-/jobs/artifacts/master/raw/funkwhale?job=build-linux" -o /usr/local/bin/funkwhale +chmod +x /usr/local/bin/funkwhale +``` + +On Windows: + +``` +curl -L "https://dev.funkwhale.audio/funkwhale/cli/-/jobs/artifacts/master/raw/funkwhale.exe?job=build-windows" -o funkwhale.exe +``` + +# Usage + +``funkwhale --help`` + +# Installation (from source) + This cli requires python 3.6 or greater: git clone https://dev.funkwhale.audio/funkwhale/cli.git cd cli pip install . -# Usage - -``funkwhale --help`` # Build the binary diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000000000000000000000000000000000000..cd76dde93067bea93e8d81d5fa70ac13b10a907a --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,19 @@ +aiofiles +aiohttp +appdirs +click +click-log +keyring +marshmallow +python-dotenv +semver +tabulate +tqdm +pathvalidate +aioresponses +asynctest +ipdb +pytest +pytest-mock +pytest-env +pyinstaller