Skip to content

Commit

Permalink
release:V0.1.3
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoming <[email protected]>
  • Loading branch information
QQxiaoming committed Feb 6, 2024
1 parent edc8d66 commit 1404630
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 31 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- 'README_zh_CN.md'
- 'DEVELOPNOTE.md'
- '.readthedocs.yaml'
tags:
- V**
pull_request:
branches: [ main ]
paths-ignore:
Expand All @@ -29,7 +31,8 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.2.0'
version: '6.5.3'
aqtversion: ==3.1.7

- name: Install prerequisites
run: |
Expand All @@ -39,9 +42,8 @@ jobs:
- name: Build all
run: |
git fetch --tags --force
git describe --always --long --dirty --abbrev=10 --tags | awk '{print "\""$0"\""}' > git_tag.inc
sed -i 's/git_tag.inc/git_tag.ci.inc/g' QFSViewer.pro
sed -i 's/QT_DIR=\/opt\/Qt6.2.0\/6.2.0\/gcc_64/QT_DIR=$(cd "$(dirname "$0")";pwd)\/..\/Qt\/6.2.0\/gcc_64/g' build_deb.sh
sed -i 's/--long --dirty/--long/g' ./tools/generate_info.sh
sed -i 's/QT_DIR=\/opt\/Qt6.2.0\/6.2.0\/gcc_64/QT_DIR=$(cd "$(dirname "$0")";pwd)\/..\/Qt\/6.5.3\/gcc_64/g' build_deb.sh
./build_deb.sh

- name: Upload build asserts
Expand Down
47 changes: 43 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- 'README_zh_CN.md'
- 'DEVELOPNOTE.md'
- '.readthedocs.yaml'
tags:
- V**
pull_request:
branches: [ main ]
paths-ignore:
Expand All @@ -29,7 +31,8 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.2.0'
version: '6.5.3'
aqtversion: ==3.1.7

- name: Install prerequisites
run: |
Expand All @@ -40,9 +43,8 @@ jobs:
- name: Build all
run: |
git fetch --tags --force
git describe --always --long --dirty --abbrev=10 --tags | awk '{print "\""$0"\""}' > git_tag.inc
sed -i'.original' -e 's/git_tag.inc/git_tag.ci.inc/g' QFSViewer.pro
sed -i'.original' -e 's/QT_DIR=\/opt\/Qt6.2.0\/6.2.0\/gcc_64/QT_DIR=$(cd "$(dirname "$0")";pwd)\/..\/Qt\/6.2.0\/macos/g' build_dmg.sh
sed -i'.original' -e 's/--long --dirty/--long/g' ./tools/generate_info.sh
sed -i'.original' -e 's/QT_DIR=\/opt\/Qt6.2.0\/6.2.0\/gcc_64/QT_DIR=$(cd "$(dirname "$0")";pwd)\/..\/Qt\/6.5.3\/macos/g' build_dmg.sh
./build_dmg.sh

- name: Upload build asserts
Expand All @@ -56,3 +58,40 @@ jobs:
run: |
sudo hdiutil attach ./build_release/out/QFSViewer.dmg
/Volumes/QFSViewer/QFSViewer.app/Contents/MacOS/QFSViewer --version

macos_arm64:
runs-on: macos-14

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.3'
aqtversion: ==3.1.7

- name: Install prerequisites
run: |
ruby - e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2 > /dev/null
brew install --build-from-source cmake
brew install create-dmg

- name: Build all
run: |
git fetch --tags --force
sed -i'.original' -e 's/--long --dirty/--long/g' ./tools/generate_info.sh
sed -i'.original' -e 's/QT_DIR=\/opt\/Qt6.2.0\/6.2.0\/gcc_64/QT_DIR=$(cd "$(dirname "$0")";pwd)\/..\/Qt\/6.5.3\/macos/g' build_dmg.sh
./build_dmg.sh

- name: Upload build asserts
uses: actions/[email protected]
with:
name: QFSViewer_macos_arm64
path: |
./build_release/out/QFSViewer.dmg

- name: Run tests
run: |
sudo hdiutil attach ./build_release/out/QFSViewer.dmg
/Volumes/QFSViewer/QFSViewer.app/Contents/MacOS/QFSViewer --version
11 changes: 7 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- 'README_zh_CN.md'
- 'DEVELOPNOTE.md'
- '.readthedocs.yaml'
tags:
- V**
pull_request:
branches: [ main ]
paths-ignore:
Expand All @@ -29,8 +31,9 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
arch: win64_mingw81
version: '6.2.0'
arch: win64_mingw
version: '6.5.3'
aqtversion: ==3.1.7

- name: Install cmake
uses: crazy-max/ghaction-chocolatey@v3
Expand All @@ -45,10 +48,10 @@ jobs:
- name: Build all
run: |
git fetch --tags --force
git describe --always --long --abbrev=10 --tags | ./tools/awk/awk.exe '{print \"\\\"\"$0\"\\\"\"}' > git_tag.inc
./tools/sed/sed.exe -i "s/git_tag.inc/git_tag.ci.inc/g" QFSViewer.pro
./tools/sed/sed.exe -i 's/--long --dirty/--long/g' ./tools/generate_info.ps1
./tools/sed/sed.exe -i "s/QT_DIR=C:\/Qt\/Qt6.2.0\/6.2.0\/mingw81_32\/bin/QT_DIR=%Qt5_Dir%/g" ./build_setup.bat
./tools/sed/sed.exe -i "s/QT_TOOLS_DIR=C:\/Qt\/Qt6.2.0\/Tools\/mingw810_32\/bin/QT_TOOLS_DIR=C:\/ProgramData\/Chocolatey\/lib\/mingw\/tools\/install\/mingw64\/bin/g" ./build_setup.bat
c:/Windows/system32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -File "./tools/generate_info.ps1" > ./build_info.inc
./build_setup.bat

- name: Upload build asserts
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ CMakeLists.txt.user*
# rust
/target

git_tag.inc
git_tag.ci.inc
build_info.inc
.DS_Store
lang/qfsviewer_en_US.qm
lang/qfsviewer_ja_JP.qm
Expand Down
20 changes: 13 additions & 7 deletions QFSViewer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
QFSVIEWER_VERSION="$$cat(./version.txt)"

###############################################################################

!versionAtLeast(QT_VERSION, 6.5.0) {
message("Cannot use Qt $$QT_VERSION")
error("Use Qt 6.5.0 or newer")
}

# 定义需要的Qt组件
QT += core gui
QT += xml svg
Expand Down Expand Up @@ -85,27 +91,27 @@ win32:{
QMAKE_TARGET_DESCRIPTION = "QFSViewer based on Qt $$[QT_VERSION]"
QMAKE_TARGET_COPYRIGHT = "GNU General Public License v3.0"

git_tag.commands = $$quote("cd $$PWD && git describe --always --long --dirty --abbrev=10 --tags | $$PWD/tools/awk/awk.exe \'{print \"\\\"\"\$$0\"\\\"\"}\' > git_tag.inc")
build_info.commands = $$quote("c:/Windows/system32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -File \"$$PWD/tools/generate_info.ps1\" > $$PWD/build_info.inc")
}

unix:!macx:{
QMAKE_RPATHDIR=$ORIGIN
QMAKE_LFLAGS += -no-pie

git_tag.commands = $$quote("cd $$PWD && git describe --always --long --dirty --abbrev=10 --tags | awk \'{print \"\\\"\"\$$0\"\\\"\"}\' > git_tag.inc")
build_info.commands = $$quote("cd $$PWD && ./tools/generate_info.sh > build_info.inc")
}

macx:{
QMAKE_RPATHDIR=$ORIGIN
ICON = "img\ico.icns"

git_tag.commands = $$quote("cd $$PWD && git describe --always --long --dirty --abbrev=10 --tags | awk \'{print \"\\\"\"\$$0\"\\\"\"}\' > git_tag.inc")
build_info.commands = $$quote("cd $$PWD && ./tools/generate_info.sh > build_info.inc")
}

git_tag.target = $$PWD/git_tag.inc
git_tag.depends = FORCE
PRE_TARGETDEPS += $$PWD/git_tag.inc
QMAKE_EXTRA_TARGETS += git_tag
build_info.target = $$PWD/build_info.inc
build_info.depends = FORCE
PRE_TARGETDEPS += $$PWD/build_info.inc
QMAKE_EXTRA_TARGETS += build_info

###############################################################################

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# QFSViewer

English | [简体中文](./README_zh_CN.md)
🇺🇸 English | [🇨🇳 简体中文](./README_zh_CN.md)

QFSViewer is a small tool for developers to view the contents of various file system raw image files, which does not rely on the operating system mounting, does not require permission requests, and is completed entirely within the software application. Based on this feature, the tool can easily run on windows/linux/macos, and even other embedded systems. The tool is based on Qt, some code comes from other open source projects, the project fully complies with their corresponding open source agreements, attached at the end of the reference, hereby thanks. The tool interface is simple and clear, easy to operate, the main interface is as follows:

Expand Down Expand Up @@ -43,7 +43,7 @@ jffs2\fat12\fat16\fat32\exfat\ext4\ext3\ext2

If you have suggestions or ideas for this project, please submit issues and pull requests on GitHub or Gitee.

The current project is recommended to use version Qt6.2.0 or higher.
The current project is recommended to use version Qt6.5.0 or higher.

## Thanks

Expand Down
4 changes: 2 additions & 2 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# QFSViewer

[English](./README.md) | 简体中文
[🇺🇸 English](./README.md) | 🇨🇳 简体中文

QFSViewer一款用于开发人员查看各种文件系统原始映像文件内容的小工具,特点是不需要依赖操作系统挂载,不需要权限申请,全部在软件应用内完成,基于此特点,该工具可以轻松运行在windows/linux/macos,甚至其他嵌入式系统。该工具基于Qt,部分代码来源自其他开源项目,项目完全遵守其对应的开源协议,文末附上引用,特此感谢。该工具界面简单清晰,操作便携,主界面如下:

Expand Down Expand Up @@ -43,7 +43,7 @@ jffs2\fat12\fat16\fat32\exfat\ext4\ext3\ext2

如果您对本项目有建议或想法,欢迎在GitHub或Gitee上提交issue和pull requests。

目前项目建议使用版本Qt6.2.0或更高版本。
目前项目建议使用版本Qt6.5.0或更高版本。

## 感谢

Expand Down
2 changes: 1 addition & 1 deletion dpkg/QFSViewer/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Architecture: amd64
Section: utils
Depends:
Recommends:
Source: QFSViewer
Source: qfsviewer
Installed-Size: #SIZE#
Priority: extra
Maintainer: QQxiaoming <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions git_tag.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"V0.1.1-11-gb8890211b6"
11 changes: 7 additions & 4 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@
#include "ui_mainwindow.h"


const static QString VERSION = APP_VERSION;
const static QString GIT_TAG =
#include "git_tag.inc"
;
#include "build_info.inc"

const QString VERSION = APP_VERSION;
const QString GIT_TAG = BUILD_INFO;
const QString DATE_TAG = BUILD_DATE;
const QString HASH_TAG = BUILD_HASH;
const QString SHORT_HASH_TAG = BUILD_SHORT_HASH;

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
Expand Down
20 changes: 20 additions & 0 deletions tools/generate_info.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

$git_info = $(git describe --always --long --dirty --abbrev=10 --tags)
$git_short_hash = $(git rev-parse --short HEAD)
$git_hash = $(git rev-parse HEAD)
$date_info = $([String]::Format("{0:yyyy-MM-ddTHH:mm:ss.fffZ}", $(Get-Date).ToUniversalTime()))

Write-Output "#ifndef __BUILD_INFO_H__"
Write-Output "#define __BUILD_INFO_H__"
Write-Output ""
Write-Output "#define BUILD_INFO ""$git_info"""
Write-Output "#define BUILD_INFO_LEN $($git_info.Length)"
Write-Output "#define BUILD_HASH ""$git_hash"""
Write-Output "#define BUILD_HASH_LEN $($git_hash.Length)"
Write-Output "#define BUILD_SHORT_HASH ""$git_short_hash"""
Write-Output "#define BUILD_SHORT_HASH_LEN $($git_short_hash.Length)"
Write-Output "#define BUILD_DATE ""$date_info"""
Write-Output "#define BUILD_DATE_LEN $($date_info.Length)"
Write-Output ""
Write-Output "#endif // __BUILD_INFO_H__"

28 changes: 28 additions & 0 deletions tools/generate_info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

UNAMEOUT="$(uname -s)"
case "${UNAMEOUT}" in
Linux*)
date_info=$(date +"%Y-%m-%dT%H:%M:%S.%3NZ")
;;
Darwin*)
date_info=$(gdate +"%Y-%m-%dT%H:%M:%S.%3NZ")
;;
esac

git_info=$(git describe --always --long --dirty --abbrev=10 --tags)
git_short_hash=$(git rev-parse --short HEAD)
git_hash=$(git rev-parse HEAD)

echo "#ifndef __BUILD_INFO_H__"
echo "#define __BUILD_INFO_H__"
echo
echo "#define BUILD_INFO \"${git_info}\""
echo "#define BUILD_INFO_LEN ${#git_info}"
echo "#define BUILD_HASH \"${git_hash}\""
echo "#define BUILD_HASH_LEN ${#git_hash}"
echo "#define BUILD_SHORT_HASH \"${git_short_hash}\""
echo "#define BUILD_SHORT_HASH_LEN ${#git_short_hash}"
echo "#define BUILD_DATE \"${date_info}\""
echo "#define BUILD_DATE_LEN ${#date_info}"
echo
echo "#endif /* __BUILD_INFO_H__ */"
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.2
0.1.3

0 comments on commit 1404630

Please sign in to comment.