diff --git a/.github/workflows/cd_research_on_fedora.yml b/.github/workflows/cd_research_on_fedora.yml new file mode 100644 index 000000000..d579a60c0 --- /dev/null +++ b/.github/workflows/cd_research_on_fedora.yml @@ -0,0 +1,48 @@ +name: CD for Mogan Research on Debian bookworm +on: + workflow_dispatch: + push: + tags: + - '*' + +env: + XMAKE_ROOT: y + QT_QPA_PLATFORM: offscreen + INSTALL_DIR: tmp/build/packages/app.mogan/ + +jobs: + build: + container: fedora:41 + runs-on: ubuntu-22.04 + steps: + - name: Install dependencies + run: | + sudo dnf update -y + sudo dnf install -y git xmake unzip gcc g++ curl-devel libgit2-devel fontconfig-devel \ + qt6-qtbase-devel qt6-qtsvg-devel mimalloc-devel libpng-devel + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: set XMAKE_GLOBALDIR + run: echo "XMAKE_GLOBALDIR=/tmp/xmake-global" >> $GITHUB_ENV + + - name: Xrepo update + run: xmake repo --update + + - name: Generate Installer + run: | + QA_RPATHS=0x0001 xmake pack -vD -f rpm research + cp build/xpack/research/x86_64/*rpm mogan-research-v1.2.9.7-rc3-fedora41.rpm + - name: Upload + uses: actions/upload-artifact@v3 + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + with: + path: mogan-*.rpm + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + files: mogan-*.rpm + diff --git a/xmake.lua b/xmake.lua index ccb18bc59..aafbb0c09 100644 --- a/xmake.lua +++ b/xmake.lua @@ -276,6 +276,66 @@ end -- Mogan Research includes("xmake/research.lua") +if is_mode("release") then +xpack("research") do + set_formats("nsis", "zip", "rpm", "srpm") + set_author("Darcy Shen ") + set_license("GPLv3") + set_licensefile(path.join(os.projectdir(), "LICENSE")) + set_title("Mogan Research") + set_description("user friendly distribution of GNU TeXmacs") + set_homepage("https://mogan.app") + + _, pos = string.find(XMACS_VERSION, "-") + local XMACS_VERSION_XYZ= XMACS_VERSION + if not (pos == nil) then + XMACS_VERSION_XYZ= string.sub(XMACS_VERSION, 1, pos-1) + end + set_version(XMACS_VERSION_XYZ) + + if is_plat ("windows") then + set_specfile(path.join(os.projectdir(), "packages/windows/research.nsis")) + set_specvar("PACKAGE_INSTALL_DIR", "XmacsLabs\\MoganResearch-"..XMACS_VERSION) + set_specvar("PACKAGE_NAME", "MoganResearch") + set_specvar("PACKAGE_SHORTCUT_NAME", "Mogan Research") + set_iconfile(path.join(os.projectdir(), "packages/windows/Xmacs.ico")) + set_bindir("bin") + add_installfiles(path.join(os.projectdir(), "build/packages/app.mogan/data/bin/(**)|MoganResearch.exe"), {prefixdir = "bin"}) + end + + add_targets("research") + + if is_plat ("linux") and linuxos.name() == "fedora" then + add_sourcefiles("(src/**)") + add_sourcefiles("(TeXmacs/**)") + add_sourcefiles("(xmake/**)") + add_sourcefiles("(tests/**)") + add_sourcefiles("xmake.lua") + end + + if is_plat("linux") then + on_load(function (package) + if package:with_source() then + package:set("basename", "goldfish-$(plat)-src-v$(version)") + else + package:set("basename", "goldfish-$(plat)-$(arch)-v$(version)") + end + end) + end + + if is_plat("windows") then + on_load(function (package) + local format = package:format() + if format == "nsis" then + package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-installer") + else + package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-portable") + end + end) + end +end +end + -- Mogan Beamer if is_plat("macosx", "windows") then diff --git a/xmake/research.lua b/xmake/research.lua index 004537c58..e4f2e10b4 100644 --- a/xmake/research.lua +++ b/xmake/research.lua @@ -297,42 +297,6 @@ target("research") do end end - -if is_mode("release") then -xpack("research") do - set_formats("nsis", "zip") - set_specfile(path.join(os.projectdir(), "packages/windows/research.nsis")) - set_specvar("PACKAGE_INSTALL_DIR", "XmacsLabs\\MoganResearch-"..XMACS_VERSION) - set_specvar("PACKAGE_NAME", "MoganResearch") - set_specvar("PACKAGE_SHORTCUT_NAME", "Mogan Research") - _, pos = string.find(XMACS_VERSION, "-") - local XMACS_VERSION_XYZ= XMACS_VERSION - if not (pos == nil) then - XMACS_VERSION_XYZ= string.sub(XMACS_VERSION, 1, pos-1) - end - set_version(XMACS_VERSION_XYZ) - set_title("Mogan Research") - set_author("XmacsLabs") - set_description("user friendly distribution of GNU TeXmacs") - set_homepage("https://mogan.app") - set_license("GPLv3") - set_licensefile(path.join(os.projectdir(), "LICENSE")) - add_targets("research") - set_iconfile(path.join(os.projectdir(), "packages/windows/Xmacs.ico")) - set_bindir("bin") - add_installfiles(path.join(os.projectdir(), "build/packages/app.mogan/data/bin/(**)|MoganResearch.exe"), {prefixdir = "bin"}) - on_load(function (package) - local format = package:format() - if format == "nsis" then - package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-installer") - else - package:set("basename", "MoganResearch-v" .. package:version() .. "-64bit-portable") - end - end) -end -end - - target("research_packager") do set_enabled(is_plat("macosx") and is_mode("release")) set_kind("phony")