Skip to content

Commit

Permalink
⭐️ Fixes #1 (not available metadata). GitHub action for GUI build cre…
Browse files Browse the repository at this point in the history
…ated on macOS.
  • Loading branch information
exislow committed Dec 20, 2023
1 parent 71c6c2e commit 6bee034
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 12 deletions.
88 changes: 81 additions & 7 deletions .github/workflows/on-release-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,24 +30,101 @@ 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
runs-on: ubuntu-latest
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}}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
28 changes: 25 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <cen.sored@gmail.com>"]
repository = "https://github.com/exislow/tidal-dl-ng"
Expand All @@ -13,7 +13,7 @@ packages = [
[tool.poetry]
name = "tidal-dl-ng"
authors = ["Robert Honz <cen.sored@gmail.com>"]
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/"
Expand Down
Binary file added tidal_dl_ng/ui/icon.icns
Binary file not shown.

0 comments on commit 6bee034

Please sign in to comment.