Chocolatey packaging added

This commit is contained in:
KR Tirtho 2022-01-18 11:10:02 +06:00
parent 7edb0bb834
commit 4048fb2143
7 changed files with 129 additions and 13 deletions

View File

@ -1,9 +1,8 @@
name: Flutter Cross Build name: Flutter Cross Build
env:
INNO_VERSION: 6.2.0
on: on:
push: push:
branches: [build] branches:
- build
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -39,12 +38,14 @@ jobs:
- uses: subosito/flutter-action@v2.2.0 - uses: subosito/flutter-action@v2.2.0
- run: flutter config --enable-windows-desktop - run: flutter config --enable-windows-desktop
- run: flutter build windows - run: flutter build windows
- run: curl -L -o installer.exe http://files.jrsoftware.org/is/6/innosetup-${{ env.INNO_VERSION }}.exe - uses: crazy-max/ghaction-chocolatey@v1
- run: ./installer.exe /verysilent /allusers /dir=iscc - run: choco install make -y
- run: ./iscc/iscc.exe scripts/windows-setup-creator.iss - run: make innoinstall
- run: rm -recurse iscc - run: make inno
- run: rm installer.exe - run: make choco
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: Spotube-Windows-Bundle 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

2
.gitignore vendored
View File

@ -62,3 +62,5 @@ app.*.map.json
/iscc /iscc
installer.exe installer.exe
/choco-struct/tools/*.exe

View File

@ -1,4 +1,5 @@
INNO_VERSION=6.2.0
TEMP_DIR=/tmp/spotube-tar
USR_SHARE=deb-struct/usr/share USR_SHARE=deb-struct/usr/share
BUNDLE_DIR=build/linux/x64/release/bundle BUNDLE_DIR=build/linux/x64/release/bundle
deb: deb:
@ -9,7 +10,6 @@ deb:
&& cp assets/spotube-logo.png $(USR_SHARE)/icons/spotube\ && cp assets/spotube-logo.png $(USR_SHARE)/icons/spotube\
&& dpkg-deb -b deb-struct/ build/Spotube-linux-x86_64.deb && dpkg-deb -b deb-struct/ build/Spotube-linux-x86_64.deb
TEMP_DIR=/tmp/spotube-tar
tar: tar:
mkdir -p $(TEMP_DIR)\ mkdir -p $(TEMP_DIR)\
&& cp -r $(BUNDLE_DIR)/* $(TEMP_DIR)\ && cp -r $(BUNDLE_DIR)/* $(TEMP_DIR)\
@ -36,3 +36,14 @@ flatpak:
rm -rf build/flatpak\ rm -rf build/flatpak\
&& rm -rf .flatpak-builder/build\ && rm -rf .flatpak-builder/build\
&& flatpak-builder build/flatpak oss.krtirtho.Spotube.yml && 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

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesnt appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<!-- == PACKAGE SPECIFIC SECTION == -->
<id>spotube</id>
<version>1.0.1</version>
<packageSourceUrl>https://github.com/KRTirtho/spotube/tree/master/choco</packageSourceUrl>
<owners>Kingkor Roy Tirtho</owners>
<!-- ============================== -->
<!-- == SOFTWARE SPECIFIC SECTION == -->
<title>spotube (Install)</title>
<authors>Kingkor Roy Tirtho</authors>
<projectUrl>https://github.com/KRTirtho/spotube/</projectUrl>
<iconUrl>https://rawcdn.githack.com/KRTirtho/spotube/7edb0bb834eb18c05551e30a891720a6abf53dbe/assets/spotube-logo.png</iconUrl>
<copyright>2022 Spotube</copyright>
<!-- If there is a license Url available, it is required for the community feed -->
<licenseUrl>https://github.com/KRTirtho/spotube/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/KRTirtho/spotube</projectSourceUrl>
<docsUrl>https://github.com/KRTirtho/spotube#readme</docsUrl>
<bugTrackerUrl>https://github.com/KRTirtho/spotube/issues/new</bugTrackerUrl>
<tags>spotube music audio spotify youtube flutter</tags>
<summary>A lightweight free Spotify 🎧 desktop-client 🖥 which handles playback manually, streams music using Youtube &amp; no Spotify premium account is needed 😱</summary>
<description>
Spotube is a Flutter based lightweight spotify client. It utilizes the power
of Spotify &amp; Youtube's public API &amp; creates a hazardless, performant &amp; resource
friendly User Experience
# Features
- Open Source
- No telementry, diagnostics or user data collection
- Lightweight &amp; resource friendly
- Native performance (Thanks to Flutter+Skia)
- Playback control is on user's machine instead of server based
- Small size &amp; less data hungry
- No spotify or youtube ads since it uses all public &amp; 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)
</description>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>

View File

@ -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.

View File

@ -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

View File

@ -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)"}
}