From 08c8886aa200262b66523b06c2aca86d85a611df Mon Sep 17 00:00:00 2001 From: Meowchestra <42126400+Meowchestra@users.noreply.github.com> Date: Sat, 25 Jan 2025 14:21:38 -0800 Subject: [PATCH] Attach Build Artifact --- .github/workflows/xmake-release.yaml | 19 +++++- .github/workflows/xmake.yaml | 19 ++++-- .../org.midieditor.manual/meta/package.xml | 4 +- .../meta/package.xml | 4 +- scripts/packaging/windows/config.xml | 2 +- scripts/xmake/packages.lua | 4 +- xmake.lua | 59 ++++++++----------- 7 files changed, 62 insertions(+), 49 deletions(-) diff --git a/.github/workflows/xmake-release.yaml b/.github/workflows/xmake-release.yaml index 847ddf14..aac55a5c 100644 --- a/.github/workflows/xmake-release.yaml +++ b/.github/workflows/xmake-release.yaml @@ -13,6 +13,15 @@ jobs: with: xmake-version: latest + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + version: '6.8.1' + host: 'windows' + target: 'desktop' + arch: 'win64_msvc2022_64' + modules: 'qtmultimedia' + - name: update repo run: | xrepo update-repo @@ -57,13 +66,13 @@ jobs: xmake doxygen --yes - name: Release installer - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: body_path: ${{ github.workspace }}/CHANGELOG.md draft: ${{ startsWith(github.ref, 'refs/tags/nightly') }} fail_on_unmatched_files: true files: | - build/website/MidiEditor.exe + build/website/ProMidEdit.exe - name: Publish website run: | @@ -73,3 +82,9 @@ jobs: git add . git commit -m "Generate Website for ${{ github.ref }}" git push + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ProMidEdit-Installer + path: packaging/Install.exe \ No newline at end of file diff --git a/.github/workflows/xmake.yaml b/.github/workflows/xmake.yaml index 4cad3944..46a61e74 100644 --- a/.github/workflows/xmake.yaml +++ b/.github/workflows/xmake.yaml @@ -19,10 +19,6 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - uses: xmake-io/github-action-setup-xmake@v1 with: xmake-version: latest @@ -40,6 +36,10 @@ jobs: run: | xrepo update-repo + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: cache packages from xrepo uses: actions/cache@v4 with: @@ -62,6 +62,13 @@ jobs: run: | xmake config --yes --verbose --diagnosis - - name: build by xmake + - name: build and create installer run: | - xmake build --verbose --diagnosis --jobs=2 \ No newline at end of file + xmake build --verbose --diagnosis --jobs=2 + xmake install installer + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ProMidEdit-Installer + path: packaging/Install.exe \ No newline at end of file diff --git a/packaging/org.midieditor.manual/meta/package.xml b/packaging/org.midieditor.manual/meta/package.xml index 327805b3..e9dc3eee 100644 --- a/packaging/org.midieditor.manual/meta/package.xml +++ b/packaging/org.midieditor.manual/meta/package.xml @@ -1,9 +1,9 @@ Manual - manual of ProMidEdit + Manual of ProMidEdit 3.9.0 - 2025-01-24 + 2025-01-25 org.midieditor.manual true false diff --git a/packaging/org.midieditor.midieditor/meta/package.xml b/packaging/org.midieditor.midieditor/meta/package.xml index 8d865d25..7184ff84 100644 --- a/packaging/org.midieditor.midieditor/meta/package.xml +++ b/packaging/org.midieditor.midieditor/meta/package.xml @@ -2,8 +2,8 @@ ProMidEdit ProMidEdit is a free software providing an interface to edit, record, and play Midi data. Packed with all necessary dependencies. - 3.4.0 - 2022-01-31 + 3.9.0 + 2025-01-25 org.midieditor.midieditor diff --git a/scripts/packaging/windows/config.xml b/scripts/packaging/windows/config.xml index 2c278c1a..13785e6c 100644 --- a/scripts/packaging/windows/config.xml +++ b/scripts/packaging/windows/config.xml @@ -10,7 +10,7 @@ @TargetDir@/ProMidEdit.exe - run midieditor + Run ProMidEdit ProMidEdit true diff --git a/scripts/xmake/packages.lua b/scripts/xmake/packages.lua index 8b137891..e40b76c4 100644 --- a/scripts/xmake/packages.lua +++ b/scripts/xmake/packages.lua @@ -1 +1,3 @@ - +function add_all_requires() + add_requires("qtifw") +end \ No newline at end of file diff --git a/xmake.lua b/xmake.lua index 36d941a9..13de9ed5 100644 --- a/xmake.lua +++ b/xmake.lua @@ -10,15 +10,14 @@ option("generate-repository", { showmenu = true, }) +includes("scripts/xmake/packages.lua") +add_all_requires() + local installdir = "packaging/org.midieditor.midieditor/data/" target("ProMidEdit") do set_languages("cxx17") add_rules("qt.widgetapp") - -- Use system Qt6 - add_includedirs("$(env QTDIR)/include") - add_linkdirs("$(env QTDIR)/lib") - -- Add Qt6 multimedia include paths explicitly after_load(function (target) local qt_dir = os.getenv("QTDIR") @@ -77,7 +76,7 @@ target("manual") do add_installfiles("manual/(**)") end -target("installer") do +target("installer") set_kind("phony") add_deps("ProMidEdit") @@ -87,36 +86,26 @@ target("installer") do add_packages("qtifw") after_install(function (target, opt) import("core.project.config") + + -- Create required directories + os.mkdir("packaging/org.midieditor.midieditor/data/bin") + + -- Copy all files from release directory + os.cp("build/windows/x64/release/*", "packaging/org.midieditor.midieditor/data/bin/") + + -- Copy additional resources + -- os.cp("run_environment/**", "packaging/org.midieditor.midieditor/data/") + + -- Generate installer local qtifw_dir = target:pkg("qtifw"):installdir() local binarycreator_path = path.join(qtifw_dir, "/bin/binarycreator.exe") - local repogen_path = path.join(qtifw_dir, "/bin/repogen.exe") - if config.get("generate-repository") then - print("generate site") - print(" generate repository") - local repo_argv = { - "--update-new-components", - "--packages", "packaging", - path.join(config.buildir(), "website", "repository") - } - os.iorunv(repogen_path, repo_argv) - print(" generate installer") - local package_argv = { - "--config", "scripts/packaging/windows/config.xml", - "--packages", "packaging", - path.join(config.buildir(), "website", "ProMidEdit.exe") - } - os.iorunv(binarycreator_path, package_argv) - print(" copy online manual") - os.cp("manual/*", path.join(config.buildir(), "website")) - else - print("generate off-line installer") - local package_argv = { - "--config", "scripts/packaging/windows/config.xml", - "--packages", "packaging", - "packaging/Install.exe" - } - os.iorunv(binarycreator_path, package_argv) - end + + print("generate off-line installer") + local package_argv = { + "--config", "scripts/packaging/windows/config.xml", + "--packages", "packaging", + "packaging/Install.exe" + } + os.iorunv(binarycreator_path, package_argv) end) - end -end + end \ No newline at end of file