diff --git a/.github/workflows/on-release-master.yml b/.github/workflows/on-release-master.yml index 4ea640a..616ede5 100644 --- a/.github/workflows/on-release-master.yml +++ b/.github/workflows/on-release-master.yml @@ -17,14 +17,11 @@ jobs: steps: - name: Check out uses: actions/checkout@v3 - - name: Set up the environment uses: ./.github/actions/setup-poetry-env - - name: Export tag id: vars run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT - - name: Build and publish run: | source .venv/bin/activate @@ -33,13 +30,25 @@ jobs: env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} RELEASE_VERSION: ${{ steps.vars.outputs.tag }} - - name: GitHub Release + id: release_create uses: softprops/action-gh-release@v1 with: draft: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Output Release URL File + run: echo "${{ steps.release_create.outputs.upload_url }}" > release_upload_url.txt + - name: Save Release URL File for publish + uses: actions/upload-artifact@v1 + with: + name: release_url + path: release_url.txt + - name: Save Upload URL File for publish + uses: actions/upload-artifact@v1 + with: + name: release_release_upload_url + path: release_upload_url.txt deploy-docs: needs: publish @@ -47,10 +56,75 @@ jobs: steps: - name: Check out uses: actions/checkout@v3 - - name: Set up the environment uses: ./.github/actions/setup-poetry-env - - name: Deploy documentation run: poetry run mkdocs gh-deploy --force -# TODO: Build Qt GUI Standalone. + + build-gui-and-upload-assets: + needs: publish + env: + OUT_NAME_FILE: "TIDAL-Downloader-NG" + ASSET_MIME: "application/zip" + ASSET_EXTENSION: ".zip" + strategy: + fail-fast: false + matrix: + #os: ["ubuntu-20.04", "windows-2019", "macos-11", "macos-13"] + include: + - os: "macos-11" + TARGET: "macos-11" + CMD_BUILD: > + brew install create-dmg && + source .venv/bin/activate && + poetry run make gui-macos && + cd dist && + zip -r ${{env.OUT_NAME_FILE}}${{env.ASSET_EXTENSION}} ${{env.OUT_NAME_FILE}}.dmg -x "*.DS_Store" + # - os: "windows-2019" + # TARGET: "windows-2019" + # CMD_BUILD: pyinstaller -F -w -n clipster -i resources/clipster.ico cli.py + runs-on: ${{ matrix.os }} + steps: + - name: Check out + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + # architecture: "x64" + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies + run: poetry install --no-interaction --all-extras --with dev + - name: Build with pyinstaller for ${{matrix.TARGET}} + run: ${{matrix.CMD_BUILD}} + - name: Load Release URL File from release job + uses: actions/download-artifact@v1 + with: + name: release_url + - name: Get Release File Name & Upload URL + id: get_release_info + shell: bash + run: | + value=`cat release_url/release_url.txt` + echo ::set-output name=release_upload_url::$value + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + upload_url: ${{steps.get_release_info.outputs.release_upload_url}} + asset_path: ./dist/${{env.OUT_NAME_FILE}}${{env.ASSET_EXTENSION}} + asset_name: ${{env.OUT_NAME_FILE}}${{env.ASSET_EXTENSION}} + asset_content_type: ${{env.ASSET_MIME}} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9687355..36af948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v0.4.11 + +- Fixes regarding empty metadata tags (also fixes #1). +- CLI downloader extended to handle playlists and mixes. +- `Download.track()` now handles logger functions. +- GUI build for macOS and asset upload. + # v0.4.9 - Fixed: Exception on missing file read (config, token) instead of creation. diff --git a/Makefile b/Makefile index 7f23fa7..cd18a10 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +app_name = "TIDAL-Downloader-NG" +app_path_dist = "dist" +path_asset = "tidal_dl_ng/ui" + .PHONY: install install: ## Install the poetry environment and install the pre-commit hooks @echo "🚀 Creating virtual environment using pyenv and poetry" @@ -53,14 +57,32 @@ docs: ## Build and serve the documentation help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' -# TODO: macos Signing: https://gist.github.com/txoof/0636835d3cc65245c6288b2374799c43 .PHONY: gui -gui: ## Build and serve the documentation +gui: ## Build GUI app with PyInstaller @poetry run pyinstaller --noconfirm \ --windowed --onefile \ --name "TIDAL Downloader NG" \ --noupx \ - --icon tidal_dl_ng/ui/icon.png \ + --icon $(path_asset)/icon.png \ tidal_dl_ng/gui.py +# TODO: macos Signing: https://gist.github.com/txoof/0636835d3cc65245c6288b2374799c43 +.PHONY: gui-macos +gui-mac: gui ## Package GUI in a *.dmg file + @poetry run mkdir -p $(app_path_dist)/dmg + @poetry run mv "$(app_path_dist)/$(app_name).app" $(app_path_dist)/dmg + @poetry run create-dmg \ + --volname "$(app_name)" \ + --volicon "$(path_asset)/icon.icns" \ + --window-pos 200 120 \ + --window-size 800 600 \ + --icon-size 100 \ + --icon "$(app_name).app" 175 120 \ + --hide-extension "$(app_name).app" \ + --app-drop-link 425 120 \ + "$(app_path_dist)/$(app_name).dmg" \ + "$(app_path_dist)/dmg/" + + + .DEFAULT_GOAL := help diff --git a/pyproject.toml b/pyproject.toml index e66bea9..c78cd6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "tidal-dl-ng" -version = "0.4.11" +version = "0.4.12" description = "TIDAL Medial Downloader Next Generation!" authors = ["Robert Honz "] repository = "https://github.com/exislow/tidal-dl-ng" @@ -13,7 +13,7 @@ packages = [ [tool.poetry] name = "tidal-dl-ng" authors = ["Robert Honz "] -version = "0.4.11" +version = "0.4.12" description = "TIDAL Medial Downloader Next Generation!" repository = "https://github.com/exislow/tidal-dl-ng" documentation = "https://exislow.github.io/tidal-dl-ng/" diff --git a/tidal_dl_ng/ui/icon.icns b/tidal_dl_ng/ui/icon.icns new file mode 100644 index 0000000..e41a4f3 Binary files /dev/null and b/tidal_dl_ng/ui/icon.icns differ