diff --git a/roles/webcatalog/tasks/Darwin.yaml b/roles/webcatalog/tasks/Darwin.yaml new file mode 100644 index 0000000..0de3cab --- /dev/null +++ b/roles/webcatalog/tasks/Darwin.yaml @@ -0,0 +1,3 @@ +--- +- set_fact: + download_url: https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-universal.dmg diff --git a/roles/webcatalog/tasks/Debian.yaml b/roles/webcatalog/tasks/Debian.yaml new file mode 100644 index 0000000..c8e5b66 --- /dev/null +++ b/roles/webcatalog/tasks/Debian.yaml @@ -0,0 +1,31 @@ +--- +- assert: {that: [ansible_machine == 'x86_64']} + +- set_fact: + filename: 'WebCatalog-{{latest.version}}.AppImage' +# TODO: Support arm64: 'WebCatalog-{{latest.version}}-arm64.AppImage' + +- name: create directory for download + file: + state: directory + dest: ~/.local/src/webcatalog + +- name: download AppImage + get_url: + url: 'https://cdn-2.webcatalog.io/webcatalog/{{filename}}' + dest: '~/.local/src/webcatalog/{{filename}}' + +- name: make AppImage executable + file: + dest: '~/.local/src/webcatalog/{{filename}}' + mode: a+x + +- name: create symbolic link + file: + src: '~/.local/src/webcatalog/{{filename}}' + dest: '~/.local/bin/WebCatalog' + state: link + +- name: create desktop file + template: + dest: io.webcatalog.WebCatalog.desktop diff --git a/roles/webcatalog/tasks/Windows.yaml b/roles/webcatalog/tasks/Windows.yaml new file mode 100644 index 0000000..acacb04 --- /dev/null +++ b/roles/webcatalog/tasks/Windows.yaml @@ -0,0 +1,5 @@ +--- +- set_fact: + filename: WebCatalog%20Setup%20{{latest.version}}.exe + +- name: download diff --git a/roles/webcatalog/tasks/main.yaml b/roles/webcatalog/tasks/main.yaml new file mode 100644 index 0000000..5b0c47f --- /dev/null +++ b/roles/webcatalog/tasks/main.yaml @@ -0,0 +1,19 @@ +--- +- name: get latest releases + uri: + url: https://raw.githubusercontent.com/kbenzie/webcatalog-release-scraper/main/webcatalog-releases.json + register: releases + +- set_fact: + latest: '{{releases.json[0]}}' + +- include_tasks: '{{ansible_os_family}}.yaml' + +# TODO: Generate these links from the changelog from 42.0.0 up + +- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-universal.dmg +- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog%20Setup%20{{latest.version}}.exe +- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}.AppImage +- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-arm64.AppImage + +# NOTE: Otherwise use https://github.com/webcatalog/webcatalog-legacy/releases diff --git a/roles/webcatalog/templates/webcatalog.desktop.j2 b/roles/webcatalog/templates/webcatalog.desktop.j2 new file mode 100644 index 0000000..0365548 --- /dev/null +++ b/roles/webcatalog/templates/webcatalog.desktop.j2 @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=WebCatalog +Exec={{command}} +Terminal=false +Type=Application +Icon=webcatalog +StartupWMClass=WebCatalog +X-AppImage-Version={{latest.version}} +Comment=Turn Any Websites Into Real Desktop Apps +MimeType=x-scheme-handler/webcatalog; +Categories=Utility;