From 4048fb2143c16266307185c997fa31f9ec1b850d Mon Sep 17 00:00:00 2001 From: KR Tirtho Date: Tue, 18 Jan 2022 11:10:02 +0600 Subject: [PATCH] Chocolatey packaging added --- .github/workflows/flutter-build.yml | 19 ++++----- .gitignore | 4 +- Makefile | 17 ++++++-- choco-struct/spotube.nuspec | 46 ++++++++++++++++++++++ choco-struct/tools/LICENSE.txt | 14 +++++++ choco-struct/tools/chocolateyinstall.ps1 | 17 ++++++++ choco-struct/tools/chocolateyuninstall.ps1 | 25 ++++++++++++ 7 files changed, 129 insertions(+), 13 deletions(-) create mode 100644 choco-struct/spotube.nuspec create mode 100644 choco-struct/tools/LICENSE.txt create mode 100644 choco-struct/tools/chocolateyinstall.ps1 create mode 100644 choco-struct/tools/chocolateyuninstall.ps1 diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index d969a380..d71f506f 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -1,9 +1,8 @@ name: Flutter Cross Build -env: - INNO_VERSION: 6.2.0 on: push: - branches: [build] + branches: + - build workflow_dispatch: jobs: @@ -39,12 +38,14 @@ jobs: - uses: subosito/flutter-action@v2.2.0 - run: flutter config --enable-windows-desktop - run: flutter build windows - - run: curl -L -o installer.exe http://files.jrsoftware.org/is/6/innosetup-${{ env.INNO_VERSION }}.exe - - run: ./installer.exe /verysilent /allusers /dir=iscc - - run: ./iscc/iscc.exe scripts/windows-setup-creator.iss - - run: rm -recurse iscc - - run: rm installer.exe + - uses: crazy-max/ghaction-chocolatey@v1 + - run: choco install make -y + - run: make innoinstall + - run: make inno + - run: make choco - uses: actions/upload-artifact@v2 with: name: Spotube-Windows-Bundle - path: build/installer/Spotube-windows-x86_64-setup.exe + path: | + build/installer/Spotube-windows-x86_64-setup.exe + build/spotube.*.nupkg \ No newline at end of file diff --git a/.gitignore b/.gitignore index 68f2caa8..064a8f08 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,6 @@ app.*.map.json /.flatpak-builder /iscc -installer.exe \ No newline at end of file +installer.exe + +/choco-struct/tools/*.exe \ No newline at end of file diff --git a/Makefile b/Makefile index 43193dd1..86caa4d8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ - +INNO_VERSION=6.2.0 +TEMP_DIR=/tmp/spotube-tar USR_SHARE=deb-struct/usr/share BUNDLE_DIR=build/linux/x64/release/bundle deb: @@ -9,7 +10,6 @@ deb: && cp assets/spotube-logo.png $(USR_SHARE)/icons/spotube\ && dpkg-deb -b deb-struct/ build/Spotube-linux-x86_64.deb -TEMP_DIR=/tmp/spotube-tar tar: mkdir -p $(TEMP_DIR)\ && cp -r $(BUNDLE_DIR)/* $(TEMP_DIR)\ @@ -35,4 +35,15 @@ publishaur: flatpak: rm -rf build/flatpak\ && rm -rf .flatpak-builder/build\ - && flatpak-builder build/flatpak oss.krtirtho.Spotube.yml \ No newline at end of file + && flatpak-builder build/flatpak oss.krtirtho.Spotube.yml + +innoinstall: + powershell curl -o build\installer.exe http://files.jrsoftware.org/is/6/innosetup-${INNO_VERSION}.exe + powershell build\installer.exe /verysilent /allusers /dir=build\iscc + +inno: + powershell build\iscc\iscc.exe scripts\windows-setup-creator.iss + +choco: + powershell cp build\installer\Spotube-windows-x86_64-setup.exe choco-struct\tools + powershell choco pack .\choco-struct\spotube.nuspec --outputdirectory build \ No newline at end of file diff --git a/choco-struct/spotube.nuspec b/choco-struct/spotube.nuspec new file mode 100644 index 00000000..4116ddd8 --- /dev/null +++ b/choco-struct/spotube.nuspec @@ -0,0 +1,46 @@ + + + + + + spotube + 1.0.1 + https://github.com/KRTirtho/spotube/tree/master/choco + Kingkor Roy Tirtho + + + + spotube (Install) + Kingkor Roy Tirtho + https://github.com/KRTirtho/spotube/ + https://rawcdn.githack.com/KRTirtho/spotube/7edb0bb834eb18c05551e30a891720a6abf53dbe/assets/spotube-logo.png + 2022 Spotube + + https://github.com/KRTirtho/spotube/blob/master/LICENSE + true + https://github.com/KRTirtho/spotube + https://github.com/KRTirtho/spotube#readme + https://github.com/KRTirtho/spotube/issues/new + spotube music audio spotify youtube flutter + A lightweight free Spotify 🎧 desktop-client 🖥 which handles playback manually, streams music using Youtube & no Spotify premium account is needed 😱 + + Spotube is a Flutter based lightweight spotify client. It utilizes the power + of Spotify & Youtube's public API & creates a hazardless, performant & resource + friendly User Experience + + # Features + - Open Source + - No telementry, diagnostics or user data collection + - Lightweight & resource friendly + - Native performance (Thanks to Flutter+Skia) + - Playback control is on user's machine instead of server based + - Small size & less data hungry + - No spotify or youtube ads since it uses all public & free APIs (But it's recommended to support the creators by watching/liking/subscribing to the artists youtube channel or add as favourite track in spotify. Mostly buying spotify premium is the best way to support their valuable creations) + - Lyrics + - Downloadable track (WIP) + + + + + + diff --git a/choco-struct/tools/LICENSE.txt b/choco-struct/tools/LICENSE.txt new file mode 100644 index 00000000..6d460a42 --- /dev/null +++ b/choco-struct/tools/LICENSE.txt @@ -0,0 +1,14 @@ +From: https://github.com/KRTirtho/spotube/blob/master/LICENSE + +BSD 4-Clause License + +Copyright (c) 2022 Kingkor Roy Tirtho. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software must display the following acknowledgement: +This product includes software developed by Kingkor Roy Tirtho. +4. Neither the name of the Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY KINGKOR ROY TIRTHO AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KINGKOR ROY TIRTHO AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/choco-struct/tools/chocolateyinstall.ps1 b/choco-struct/tools/chocolateyinstall.ps1 new file mode 100644 index 00000000..8e84266e --- /dev/null +++ b/choco-struct/tools/chocolateyinstall.ps1 @@ -0,0 +1,17 @@ +$ErrorActionPreference = 'Stop'; # stop on all errors + +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$fileLocation = Join-Path $toolsDir 'Spotube-windows-x86_64-setup.exe' + +$packageArgs = @{ + packageName = $env:ChocolateyPackageName + unzipLocation = $toolsDir + fileType = 'exe' #only one of these: exe, msi, msu + file = $fileLocation + + softwareName = 'spotube*' #part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique + silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' # Inno Setup + validExitCodes= @(0) +} + +Install-ChocolateyInstallPackage @packageArgs \ No newline at end of file diff --git a/choco-struct/tools/chocolateyuninstall.ps1 b/choco-struct/tools/chocolateyuninstall.ps1 new file mode 100644 index 00000000..17b8e929 --- /dev/null +++ b/choco-struct/tools/chocolateyuninstall.ps1 @@ -0,0 +1,25 @@ +$ErrorActionPreference = 'Stop'; # stop on all errors +$packageArgs = @{ + packageName = $env:ChocolateyPackageName + softwareName = 'spotube*' + fileType = 'exe' + validExitCodes= @(0, 3010, 1605, 1614, 1641) + silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' # Inno Setup +} + +[array]$key = Get-UninstallRegistryKey -SoftwareName $packageArgs['softwareName'] + +if ($key.Count -eq 1) { + $key | % { + $packageArgs['file'] = "$($_.UninstallString)" #NOTE: You may need to split this if it contains spaces, see below + + Uninstall-ChocolateyPackage @packageArgs + } +} elseif ($key.Count -eq 0) { + Write-Warning "$packageName has already been uninstalled by other means." +} elseif ($key.Count -gt 1) { + Write-Warning "$($key.Count) matches found!" + Write-Warning "To prevent accidental data loss, no programs will be uninstalled." + Write-Warning "Please alert package maintainer the following keys were matched:" + $key | % {Write-Warning "- $($_.DisplayName)"} +} \ No newline at end of file