add chocolatey & add test for chocolatey package

This commit is contained in:
Егор 2024-11-14 21:26:34 +05:00
parent 7e88c422d4
commit dfde28f76f
9 changed files with 356 additions and 5 deletions

View File

@ -59,7 +59,7 @@ jobs:
path: './build/installer.exe'
# Test Package
package:
deb-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -72,7 +72,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: package
name: deb-package
# Upload entire repository
path: './build/package.deb'
@ -94,3 +94,20 @@ jobs:
- name: Remove package
run: sudo apt remove kos32-gcc
#Test chocolatey package
chocolatey-package:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cmake -B ${{ github.workspace }}/build
cmake --build ${{ github.workspace }}/build --target
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: choco-package
# Upload entire repository
path: './build/'

View File

@ -7,7 +7,7 @@ project(
add_custom_target(
Package
deb
COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/install.sh ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/postinst
COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/copyright
COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN
@ -18,9 +18,19 @@ add_custom_target(
COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/copyright
COMMAND dpkg-deb --build ${CMAKE_CURRENT_SOURCE_DIR}/package ${CMAKE_CURRENT_BINARY_DIR}/package.deb
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Build deb package"
)
add_custom_target(
Installer
COMMAND iscc /O"${CMAKE_CURRENT_BINARY_DIR}" ${CMAKE_CURRENT_SOURCE_DIR}/installator.iss
COMMENT "Build windows installer"
)
add_custom_target(
choco
COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/install.ps1 ${CMAKE_CURRENT_SOURCE_DIR}/chocolatey/tools
COMMAND choco pack
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/chocolatey
COMMENT "Build chocolatey package"
)

View File

@ -0,0 +1,28 @@
<?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/2010/07/nuspec.xsd">
<metadata>
<!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages -->
<id>kos32-gcc</id>
<title>KolibriOS gcc toolchain installer</title>
<version>0.1.5</version>
<authors>Egor00f</authors>
<owners>Egor00f</owners>
<summary>__REPLACE__</summary>
<description>_KolibriOS gcc toolchain installer. This package installing KolibriOS gcc toolchain by Serge.</description>
<packageSourceUrl>https://github.com/Egor00f/kolibrios-gcc-toolchain/</packageSourceUrl>
<tags>kolibrios toolchain compiler c/C++</tags>
<copyright></copyright>
<licenseUrl>https://github.com/Egor00f/kolibrios-gcc-toolchain/blob/main/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<!-- Important note about https://cdn.rawgit.com: Files are cached permanently after the first request. Use commit URLs when updating the icon. -->
<!--<iconUrl>http://cdn.rawgit.com/__CHOCO_PKG_MAINTAINER_REPO__/master/icons/__NAME__.png</iconUrl>-->
<!--<dependencies>
<dependency id="" version="" />
</dependencies>-->
<releaseNotes></releaseNotes>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>

View File

@ -0,0 +1,12 @@
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one
$packageName = 'kos32-gcc' # arbitrary name for the package, used in messages
$url = 'http://ftp.kolibrios.org/users/Serge/new/Toolchain/msys-kos32-5.4.0.7z' # download url
$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
# main helpers - these have error handling tucked into them already
# installer, will assert administrative rights
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" -validExitCodes $validExitCodes
.\install.ps1

View File

View File

@ -0,0 +1,82 @@
@echo off
for /f %%a in ('echo prompt $E^| cmd') do set "ESC=%%a"
set DEFAULT_TOOLCHAIN_DIR=C:\MinGW\msys\1.0\home\autobuild\tools
if [%1] == [] (
set TOOLCHAIN_DIR=%DEFAULT_TOOLCHAIN_DIR%
)
else (
set TOOLCHAIN_DIR=%1
)
Call :print_msg Create the %TOOLCHAIN_DIR% folder...
mkdir %TOOLCHAIN_DIR%
Call :print_ok Successfully!
call :print_msg Download the kos32-gcc toolchain...
cd %TOOLCHAIN_DIR%
wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/msys-kos32-5.4.0.7z -O %TOOLCHAIN_DIR%\kos32-toolchain.7z
7z x -y %TOOLCHAIN_DIR%\kos32-toolchain.7z -o%TOOLCHAIN_DIR%
Call :print_ok Successfully!
Call :print_msg Downloading libraries...
cd %TOOLCHAIN_DIR%\win32\mingw32
wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -O %TOOLCHAIN_DIR%\win32\mingw32\sdk-28-10-16.7z
7z x -y %TOOLCHAIN_DIR%\win32\mingw32\sdk-28-10-16.7z
Call :print_ok Successfully!
Call :print_msg Updating libraries
cd %TOOLCHAIN_DIR%\win32\mingw32\lib
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libdll.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libdll.a
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libfreetype.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libfreetype.a
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libc.dll.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libc.dll.a
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libSDLn.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libSDLn.a
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libcurses.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libcurses.a
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libz.dll.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libz.dll.a
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libogg.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libogg.a
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libvorbis.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libvorbis.a
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libopenjpeg.a -O %TOOLCHAIN_DIR%\win32\mingw32\lib\libopenjpeg.a
Call :print_ok Successfully!
Call :print_msg Adding C:\MinGW\msys\1.0\home\autobuild\tools\win32\bin to PATH
set PATH=%PATH%;%TOOLCHAIN_DIR%%\win32\bin
Call :print_ok Installation was successful!
:print_msg
echo %ESC%[34m%*%ESC%[%m
exit /b
:print_ok
echo %ESC%[32m%*%ESC%[%m
exit /b

202
install.ps1 Normal file
View File

@ -0,0 +1,202 @@
@echo off
$DEFAULT_TOOLCHAIN_DIR="C:\MinGW\msys\1.0\home\autobuild\tools"
PSStyle.Progress.View = 'Classic'
if ()
{
$TOOLCHAIN_DIR=$DEFAULT_TOOLCHAIN_DIR
}
else
{
$TOOLCHAIN_DIR=%1
}
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "toolchain",
PercentComplete = 0,
CurrentOperation = "Create the $TOOLCHAIN_DIR folder"
}
Write-Progress @OuterLoopProgressParameters
mkdir $TOOLCHAIN_DIR
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "toolchain",
PercentComplete = 1,
CurrentOperation = "Download the kos32-gcc toolchain"
}
Write-Progress @OuterLoopProgressParameters
wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/msys-kos32-5.4.0.7z -O $TOOLCHAIN_DIR\kos32-toolchain.7z
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "toolchain",
PercentComplete = 20,
CurrentOperation = "Unpacking kos32-gcc toolchain"
}
Write-Progress @OuterLoopProgressParameters
7z x -y $TOOLCHAIN_DIR\kos32-toolchain.7z -o$TOOLCHAIN_DIR
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Installing libraries",
PercentComplete = 40,
CurrentOperation = "Downloading libraries"
}
Write-Progress @OuterLoopProgressParameters
wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -O $TOOLCHAIN_DIR\win32\mingw32\sdk-28-10-16.7z
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Installing libraries",
PercentComplete = 50,
CurrentOperation = "Downloading libraries"
}
Write-Progress @OuterLoopProgressParameters
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Installing libraries",
PercentComplete = 60,
CurrentOperation = "unpacking libraries"
}
Write-Progress @OuterLoopProgressParameters
7z x -y $TOOLCHAIN_DIR\win32\mingw32\sdk-28-10-16.7z
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 65,
CurrentOperation = "download libdll.a"
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libdll.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libdll.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 67,
CurrentOperation = "download libfreetype.a"
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libfreetype.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libfreetype.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 70,
CurrentOperation = "download libc.dll.a"
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libc.dll.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libc.dll.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 75,
CurrentOperation = "download libSDLn.a"
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libSDLn.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libSDLn.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 78,
CurrentOperation = "download libcurses.a "
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libcurses.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libcurses.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 82,
CurrentOperation = "download libz.dll.a"
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libz.dll.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libz.dll.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 85,
CurrentOperation = "download libogg.a"
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libogg.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libogg.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 88,
CurrentOperation = "download libvorbis.a"
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libvorbis.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libvorbis.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Updating libraries",
PercentComplete = 95,
CurrentOperation = "download libopenjpeg.a"
}
Write-Progress @OuterLoopProgressParameters
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libopenjpeg.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libopenjpeg.a
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Done!",
PercentComplete = 99,
CurrentOperation = "Adding C:\MinGW\msys\1.0\home\autobuild\tools\win32\bin to PATH"
}
Write-Progress @OuterLoopProgressParameters
set PATH=%PATH%;$TOOLCHAIN_DIR%\win32\bin
$OuterLoopProgressParameters = @{
Activity = "Installing toolchain"
Status = "Done!",
PercentComplete = 100,
CurrentOperation = "download libdll.a"
}
Write-Progress @OuterLoopProgressParameters
Write-Information -MessageData "Installation was successful!"

View File

@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "KolibriOS gcc toolchain"
#define MyAppVersion "0.1.4"
#define MyAppVersion "0.1.5"
#define MyAppPublisher "Egor00f"
#define MyAppURL "https://github.com/Egor00f/kolibrios-gcc-toolchain"

View File

@ -1,5 +1,5 @@
Package: kos32-gcc
Version: 0.1.4
Version: 0.1.5
Architecture: all
Section: devel
Depends: libc6-i386:amd64, libmpc3:amd64