Skip to content

Commit

Permalink
more work on github build system
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Nov 12, 2024
1 parent eb521e8 commit f044261
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 52 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/WindowsGit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
$now = (Get-Date)
$then = (Get-Date -Year 2024 -Month 5 -Day 3 -Hour 0 -Minute 0)
$then = (Get-Date -Year 2024 -Month 11 -Day 12 -Hour 0 -Minute 0)
echo "CURRENT_TIME=$($now.ToString())" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Expand All @@ -89,7 +89,7 @@ jobs:
env:
CMAKE_PREFIX_PATH: "${{github.workspace}}/qt5/Qt/${{ env.QT5_VERSION }}"
msystem: MINGW32
run: cmake -DOUTPUT_BASE_NAME=SiriKaliQt5 -DBUILD_WITH_QT6=false -DLIBRARIES_LOCATION=${{github.workspace}}\SiriKali.git\ -DOUTPUT_PATH=${{github.workspace}}\ -DSOURCE_PATH=${{github.workspace}}\SiriKali\ -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G "CodeBlocks - MinGW Makefiles" -S ${{github.workspace}}/SiriKali/ -B ${{github.workspace}}/SiriKali/build5
run: cmake -DOUTPUT_BASE_NAME=SiriKaliQt5 -DBUILD_WITH_QT6=false -DLIBRARIES_LOCATION=${{github.workspace}}\SiriKaliQt5.git\ -DOUTPUT_PATH=${{github.workspace}}\ -DSOURCE_PATH=${{github.workspace}}\SiriKali\ -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G "CodeBlocks - MinGW Makefiles" -S ${{github.workspace}}/SiriKali/ -B ${{github.workspace}}/SiriKali/build5
-
name: Print installer script for Qt5
run : get-content ${{github.workspace}}\SiriKali\build5\sirikali_windows_installer_Qt5.iss
Expand All @@ -116,19 +116,19 @@ jobs:
-
name: Create SiriKali.git.zip
run: |
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKali.git
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKali.git\local
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKali.git\extra
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKali.git\extra\bsdtar
Copy-Item ${{github.workspace}}\tmp\bsdtar\* -Destination ${{github.workspace}}\SiriKali.git\extra\bsdtar -Recurse
Copy-Item ${{github.workspace}}\tmp\libs\* -Destination ${{github.workspace}}\SiriKali.git -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\translations -Destination ${{github.workspace}}\SiriKali.git -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\build5\sirikali.exe -Destination ${{github.workspace}}\SiriKali.git
Copy-Item -Path ${{github.workspace}}\SiriKali\build5\src/sirikali_cppcryptfs\sirikali_cppcryptfs.exe -Destination ${{github.workspace}}\SiriKali.git
Set-Location ${{github.workspace}}\SiriKali.git
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt5.git
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt5.git\local
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt5.git\extra
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt5.git\extra\bsdtar
Copy-Item ${{github.workspace}}\tmp\bsdtar\* -Destination ${{github.workspace}}\SiriKaliQt5.git\extra\bsdtar -Recurse
Copy-Item ${{github.workspace}}\tmp\libs\* -Destination ${{github.workspace}}\SiriKaliQt5.git -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\translations -Destination ${{github.workspace}}\SiriKaliQt5.git -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\build5\sirikali.exe -Destination ${{github.workspace}}\SiriKaliQt5.git
Copy-Item -Path ${{github.workspace}}\SiriKali\build5\src/sirikali_cppcryptfs\sirikali_cppcryptfs.exe -Destination ${{github.workspace}}\SiriKaliQt5.git
Set-Location ${{github.workspace}}\SiriKaliQt5.git
${{github.workspace}}/qt5/Qt/${{ env.QT5_VERSION }}/${{ env.MINGW5_PATH }}/bin/windeployqt.exe ${{github.workspace}}\SiriKali.git\sirikali.exe
Expand All @@ -137,11 +137,11 @@ jobs:
echo "$bb" | Out-File -FilePath ${{github.workspace}}\SiriKali.git\version_info.txt -Encoding utf8 -Append
Compress-Archive -Path ${{github.workspace}}\SiriKali.git -DestinationPath ${{github.workspace}}\SiriKaliQt5.git.zip
Compress-Archive -Path ${{github.workspace}}\SiriKaliQt5.git -DestinationPath ${{github.workspace}}\SiriKaliQt5.git.zip
Remove-Item -Path ${{github.workspace}}\SiriKali.git\local
Remove-Item -Path ${{github.workspace}}\SiriKaliQt5.git\local
Remove-Item -Path ${{github.workspace}}\SiriKali.git\version_info.txt
Remove-Item -Path ${{github.workspace}}\SiriKaliQt5.git\version_info.txt
-
name: Make installer for Qt5
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt6.git\local
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt6.git\extra
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt6.git\extra\bsdtar
Copy-Item ${{github.workspace}}\tmp\bsdtar\* -Destination ${{github.workspace}}\SiriKaliQt6.git\extra\bsdtar -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\translations -Destination ${{github.workspace}}\SiriKaliQt6.git -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\build6\sirikali.exe -Destination ${{github.workspace}}\SiriKaliQt6.git
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/WindowsRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ jobs:
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt5-${{ env.RELEASEVERSION }}\local
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt5-${{ env.RELEASEVERSION }}\extra
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt5-${{ env.RELEASEVERSION }}\extra\bsdtar
Copy-Item ${{github.workspace}}\tmp\bsdtar\* -Destination ${{github.workspace}}\SiriKaliQt5-${{ env.RELEASEVERSION }}\extra\bsdtar -Recurse
Copy-Item ${{github.workspace}}\tmp\libs\* -Destination ${{github.workspace}}\SiriKaliQt5-${{ env.RELEASEVERSION }} -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\translations -Destination ${{github.workspace}}\SiriKaliQt5-${{ env.RELEASEVERSION }} -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\build5\sirikali.exe -Destination ${{github.workspace}}\SiriKaliQt5-${{ env.RELEASEVERSION }}
Expand Down Expand Up @@ -148,11 +148,9 @@ jobs:
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt6-${{ env.RELEASEVERSION }}\local
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt6-${{ env.RELEASEVERSION }}\extra
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt6-${{ env.RELEASEVERSION }}\extra\bsdtar
Copy-Item ${{github.workspace}}\tmp\bsdtar\* -Destination ${{github.workspace}}\SiriKaliQt6-${{ env.RELEASEVERSION }}\extra\bsdtar -Recurse
Copy-Item ${{github.workspace}}\tmp\libs\msvcr100.dll -Destination ${{github.workspace}}\SiriKaliQt6-${{ env.RELEASEVERSION }}
Copy-Item -Path ${{github.workspace}}\SiriKali\translations -Destination ${{github.workspace}}\SiriKaliQt6-${{ env.RELEASEVERSION }} -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\build6\sirikali.exe -Destination ${{github.workspace}}\SiriKaliQt6-${{ env.RELEASEVERSION }}
Expand Down
35 changes: 11 additions & 24 deletions src/checkforupdates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ checkUpdates::checkUpdates( QWidget * widget,checkforupdateswindow::functions ff
m_timeOut( settings::instance().networkTimeOut() * 1000 ),
m_network( m_timeOut ),
m_running( false ),
m_internallyManageBackEnds( settings::instance().internallyManageBackEnds() ),
m_functions( std::move( ff ) )
{
m_networkRequest.setRawHeader( "Host","api.github.com" ) ;
Expand Down Expand Up @@ -210,29 +209,17 @@ void checkUpdates::checkForUpdate( size_t position )

auto f = this->InstalledVersion( s.get() ) ;

if( f == "N/A" && m_backendsInUse == &m_backends ){
if( s->known() ){

checkforupdateswindow::args args( s.get(),m_internallyManageBackEnds ) ;

args.installedVersion = "N/A" ;
args.onLineVersion = "N/A" ;

emit update( args ) ;

this->checkForUpdate( position ) ;
}else {
if( s->known() ){

m_networkRequest.setUrl( QUrl( s->releaseURL() ) ) ;
}else{
m_networkRequest.setUrl( QUrl( "https://api.github.com/repos/mhogomchungu/sirikali/releases" ) ) ;
}
m_networkRequest.setUrl( QUrl( s->releaseURL() ) ) ;
}else{
m_networkRequest.setUrl( QUrl( "https://api.github.com/repos/mhogomchungu/sirikali/releases" ) ) ;
}

m_network.get( m_networkRequest,[ =,&s ]( const utils::network::reply& reply ){
m_network.get( m_networkRequest,[ =,&s ]( const utils::network::reply& reply ){

this->networkReply( position,s.get(),f,reply ) ;
} ) ;
}
this->networkReply( position,s.get(),f,reply ) ;
} ) ;
}
}

Expand All @@ -243,7 +230,7 @@ void checkUpdates::networkReply( int position,
{
if( reply.success() ){

checkforupdateswindow::args args( s,m_internallyManageBackEnds ) ;
checkforupdateswindow::args args( s ) ;

auto m = this->latestVersion( reply.data() ) ;

Expand All @@ -255,14 +242,14 @@ void checkUpdates::networkReply( int position,

}else if( reply.timeOut() ){

checkforupdateswindow::args args( s,m_internallyManageBackEnds ) ;
checkforupdateswindow::args args( s ) ;

auto ss = QString::number( m_timeOut / 1000 ) ;
args.error = QObject::tr( "Network Request Failed To Respond Within %1 Seconds." ).arg( ss ) ;

emit update( args ) ;
}else{
checkforupdateswindow::args args( s,m_internallyManageBackEnds ) ;
checkforupdateswindow::args args( s ) ;

args.error = reply.errorString() ;

Expand Down
1 change: 0 additions & 1 deletion src/checkforupdates.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class checkUpdates : public QObject
utils::network::manager m_network ;

bool m_running ;
bool m_internallyManageBackEnds ;

std::vector< engines::engine::Wrapper > m_backends ;
std::vector< engines::engine::Wrapper > m_backendsInstallable ;
Expand Down
6 changes: 5 additions & 1 deletion src/checkforupdateswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include "engines.h"

#include "settings.h"

checkforupdateswindow::checkforupdateswindow( QWidget * parent,
functions& ff,
utils::network::manager& nm ) :
Expand Down Expand Up @@ -63,9 +65,11 @@ checkforupdateswindow::checkforupdateswindow( QWidget * parent,

QMenu m ;

auto u = settings::instance().internallyManageBackEnds() ;

auto ac = m.addAction( tr( "Update" ) ) ;

if( m_opts[ row ].updatable() ){
if( m_opts[ row ].updatable() && u ){

ac->setEnabled( true ) ;

Expand Down
4 changes: 2 additions & 2 deletions src/checkforupdateswindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class checkforupdateswindow : public QDialog
struct args
{
template< typename Engine >
args( const Engine& s,bool canUpdate ) :
updatable( s.updatable() && canUpdate ),
args( const Engine& s ) :
updatable( s.updatable() ),
executableName( s.executableName() ),
engineName( s.known() ? s.name() : "SiriKali" ),
executableFullPath( s.executableFullPath() ),
Expand Down

0 comments on commit f044261

Please sign in to comment.