Skip to content

Commit

Permalink
Merge pull request #26 from fabiobento512/code_refactoring_and_github…
Browse files Browse the repository at this point in the history
…_actions_builds

Code refactoring and GitHub actions builds
  • Loading branch information
fabiobento512 authored Mar 13, 2022
2 parents 4c25b5e + 0f7943a commit 2c7f00d
Show file tree
Hide file tree
Showing 14 changed files with 306 additions and 125 deletions.
163 changes: 163 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: FRequest Build
on: [push]
jobs:
Build-windows:
runs-on: windows-2022
steps:
- name: Check out FRequest code
uses: actions/checkout@v3
with:
path: 'FRequest'
- name: Check out CommonLibs
uses: actions/checkout@v3
with:
repository: ${{ github.event.repository.owner.login }}/CommonLibs
path: 'CommonLibs'
- name: Check out CommonUtils
uses: actions/checkout@v3
with:
repository: ${{ github.event.repository.owner.login }}/CommonUtils
path: 'CommonUtils'
- name: Download Qt SDK and FRequest binaries
run: |
$files_url="https://github.com/${{ github.event.repository.owner.login }}/Files/releases/download"
Invoke-WebRequest "$files_url/frequestwindows/Qt5.15.2.7z" -OutFile Qt5.15.2.7z
Invoke-WebRequest "$files_url/frequestwindows/FRequestBinaries.7z" -OutFile FRequestBinaries.7z
7z.exe x -mmt=4 Qt5.15.2.7z -o"Qt5.15.2"
7z.exe x -mmt=4 FRequestBinaries.7z -o"FRequestBinaries"
- name: Set Enviroments variables for SDK
run: |
# https://stackoverflow.com/a/64831469
echo "${{ github.workspace }}\Qt5.15.2\5.15.2\mingw81_32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${{ github.workspace }}\Qt5.15.2\Tools\mingw810_32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Compile code
run: |
mkdir output
cd output
qmake ../${{ github.event.repository.name }}/FRequest.pro "CONFIG+=release"
mingw32-make -j
cd ..
- name: Copy executable / dependencies / readme / license to final folder
run: |
Invoke-WebRequest "https://github.com/${{ github.event.repository.owner.login }}/Files/releases/download/common/get_zip_name.py" -OutFile get_zip_name.py
$zip_name=python3 get_zip_name.py ${{ github.event.repository.owner.login }} ${{ github.event.repository.name }}
mkdir distributable
mkdir distributable\FRequest
cp output\release\FRequest.exe distributable\FRequest
xcopy FRequestBinaries distributable\FRequest /e
cp ${{ github.event.repository.name }}\readme.txt distributable\FRequest
cp ${{ github.event.repository.name }}\LICENSE distributable\FRequest
7z a -tzip -mmt=4 "distributable\$zip_name.zip" "${{ github.workspace }}\distributable\FRequest"
- name: Archive the final folder
uses: actions/upload-artifact@v3
with:
name: FRequest-windows
path: distributable/*.zip
Build-macos:
runs-on: macos-10.15
steps:
- name: Check out FRequest code
uses: actions/checkout@v3
with:
path: 'FRequest'
- name: Check out CommonLibs
uses: actions/checkout@v3
with:
repository: ${{ github.event.repository.owner.login }}/CommonLibs
path: 'CommonLibs'
- name: Check out CommonUtils
uses: actions/checkout@v3
with:
repository: ${{ github.event.repository.owner.login }}/CommonUtils
path: 'CommonUtils'
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 5.15.2
target: desktop
modules: none
# - name: Download and Install Qt SDK (alternative)
# # https://superuser.com/a/422785
# run: |
# brew install qt@5
# brew link qt@5
- name: Compile code
run: |
mkdir output
cd output
qmake ../${{ github.event.repository.name }}/FRequest.pro "CONFIG+=release"
make -j
cd ..
- name: Copy app bundle / readme / license to final folder
run: |
wget "https://github.com/${{ github.event.repository.owner.login }}/Files/releases/download/common/get_zip_name.py"
zip_name=$(python3 get_zip_name.py ${{ github.event.repository.owner.login }} ${{ github.event.repository.name }})
macdeployqt output/FRequest.app
mkdir distributable
mkdir distributable/FRequest
cp -R output/FRequest.app distributable/FRequest
cp ${{ github.event.repository.name }}/readme.txt distributable/FRequest
cp ${{ github.event.repository.name }}/LICENSE distributable/FRequest
7z a -tzip -mmt=4 distributable/$zip_name.zip ${{ github.workspace }}/distributable/FRequest
- name: Archive the final folder
uses: actions/upload-artifact@v3
with:
name: FRequest-macos
path: distributable/*.zip
Build-linux:
runs-on: ubuntu-18.04
steps:
- name: Check out FRequest code
uses: actions/checkout@v3
with:
path: 'FRequest'
- name: Check out CommonLibs
uses: actions/checkout@v3
with:
repository: ${{ github.event.repository.owner.login }}/CommonLibs
path: 'CommonLibs'
- name: Check out CommonUtils
uses: actions/checkout@v3
with:
repository: ${{ github.event.repository.owner.login }}/CommonUtils
path: 'CommonUtils'
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 5.15.2
target: desktop
modules: none
- name: Download and Set linuxdeployqt
run: |
wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
- name: Compile code
run: |
mkdir output
cd output
qmake ../${{ github.event.repository.name }}/FRequest.pro "CONFIG+=release"
make -j
cd ..
- name: Generate AppImage
run: |
mkdir AppImage
cp output/FRequest AppImage
cp ${{ github.event.repository.name }}/LinuxAppImageDeployment/*.* AppImage
cd AppImage
${{ github.workspace }}/linuxdeployqt-continuous-x86_64.AppImage frequest.desktop -no-translations -appimage
cd ..
- name: Copy AppImage / readme / license to final folder
run: |
wget "https://github.com/${{ github.event.repository.owner.login }}/Files/releases/download/common/get_zip_name.py"
zip_name=$(python3 get_zip_name.py ${{ github.event.repository.owner.login }} ${{ github.event.repository.name }})
mkdir distributable
mkdir distributable/FRequest
cp ${{ github.event.repository.name }}/readme.txt distributable/FRequest
cp ${{ github.event.repository.name }}/LICENSE distributable/FRequest
cp AppImage/FRequest-x86_64.AppImage distributable/FRequest
7z a -tzip -mmt=4 distributable/$zip_name ${{ github.workspace }}/distributable/FRequest
- name: Archive the final folder
uses: actions/upload-artifact@v3
with:
name: FRequest-linux
path: distributable/*.zip
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ignore QtCreator user files
*.pro.user
*.pro.user*

# ignore MacOS specific files
*.DS_Store
2 changes: 1 addition & 1 deletion FRequest.pro
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ RESOURCES += \
macx {
RESOURCES += \
Resources/macos_resources.qrc
}
}
2 changes: 2 additions & 0 deletions Widgets/frequesttreewidgetprojectitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "frequesttreewidgetrequestitem.h"
#include "utilfrequest.h"

#include <memory>

class FRequestTreeWidgetProjectItem : public FRequestTreeWidgetItem
{
public:
Expand Down
Loading

0 comments on commit 2c7f00d

Please sign in to comment.