From 42c5f9169f87ab1e1773604661597039d221fd56 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 1 Dec 2024 14:08:59 +1000 Subject: [PATCH] CI: Merge all packaging scripts to one directory --- .github/workflows/linux-appimage-build.yml | 8 ++++---- .github/workflows/linux-flatpak-build.yml | 12 ++++++------ scripts/clang-toolchain.cmake | 5 ----- .../appimage/apprun-hooks/default-to-x11.sh | 0 .../{ => packaging}/appimage/install-packages.sh | 0 scripts/{ => packaging}/appimage/make-appimage.sh | 4 ++-- scripts/{ => packaging}/flatpak/.gitignore | 0 .../flatpak/modules/10-libbacktrace.yaml | 0 .../{ => packaging}/flatpak/modules/11-libzip.yaml | 0 .../{ => packaging}/flatpak/modules/20-sdl2.yaml | 0 .../{ => packaging}/flatpak/modules/21-shaderc.yaml | 0 .../flatpak/modules/22-spirv-cross.yaml | 0 .../{ => packaging}/flatpak/modules/23-cpuinfo.yaml | 0 .../flatpak/modules/24-discord-rpc.yaml | 0 .../flatpak/modules/25-soundtouch.yaml | 0 .../{ => packaging}/flatpak/modules/26-lunasvg.yaml | 0 .../flatpak/org.duckstation.DuckStation.yaml | 8 ++++---- scripts/{ => packaging}/generate-metainfo.sh | 0 .../org.duckstation.DuckStation.desktop | 0 .../org.duckstation.DuckStation.metainfo.xml.in | 0 .../{ => packaging}/org.duckstation.DuckStation.png | Bin 21 files changed, 16 insertions(+), 21 deletions(-) delete mode 100644 scripts/clang-toolchain.cmake rename scripts/{ => packaging}/appimage/apprun-hooks/default-to-x11.sh (100%) rename scripts/{ => packaging}/appimage/install-packages.sh (100%) rename scripts/{ => packaging}/appimage/make-appimage.sh (97%) rename scripts/{ => packaging}/flatpak/.gitignore (100%) rename scripts/{ => packaging}/flatpak/modules/10-libbacktrace.yaml (100%) rename scripts/{ => packaging}/flatpak/modules/11-libzip.yaml (100%) rename scripts/{ => packaging}/flatpak/modules/20-sdl2.yaml (100%) rename scripts/{ => packaging}/flatpak/modules/21-shaderc.yaml (100%) rename scripts/{ => packaging}/flatpak/modules/22-spirv-cross.yaml (100%) rename scripts/{ => packaging}/flatpak/modules/23-cpuinfo.yaml (100%) rename scripts/{ => packaging}/flatpak/modules/24-discord-rpc.yaml (100%) rename scripts/{ => packaging}/flatpak/modules/25-soundtouch.yaml (100%) rename scripts/{ => packaging}/flatpak/modules/26-lunasvg.yaml (100%) rename scripts/{ => packaging}/flatpak/org.duckstation.DuckStation.yaml (90%) rename scripts/{ => packaging}/generate-metainfo.sh (100%) rename scripts/{ => packaging}/org.duckstation.DuckStation.desktop (100%) rename scripts/{ => packaging}/org.duckstation.DuckStation.metainfo.xml.in (100%) rename scripts/{ => packaging}/org.duckstation.DuckStation.png (100%) diff --git a/.github/workflows/linux-appimage-build.yml b/.github/workflows/linux-appimage-build.yml index 9fc059ff0..51ec4b9cd 100644 --- a/.github/workflows/linux-appimage-build.yml +++ b/.github/workflows/linux-appimage-build.yml @@ -14,7 +14,7 @@ jobs: fetch-depth: 0 - name: Install Packages - run: scripts/appimage/install-packages.sh + run: scripts/packaging/appimage/install-packages.sh - name: Cache Dependencies id: cache-deps @@ -66,7 +66,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" .. cmake --build . --parallel cd .. - scripts/appimage/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64 + scripts/packaging/appimage/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64 - name: Upload Qt AppImage uses: actions/upload-artifact@v4.3.3 @@ -85,7 +85,7 @@ jobs: fetch-depth: 0 - name: Install Packages - run: scripts/appimage/install-packages.sh + run: scripts/packaging/appimage/install-packages.sh - name: Cache Dependencies id: cache-deps @@ -137,7 +137,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DDISABLE_SSE4=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" .. cmake --build . --parallel cd .. - scripts/appimage/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64-SSE2 + scripts/packaging/appimage/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64-SSE2 - name: Upload Qt AppImage uses: actions/upload-artifact@v4.3.3 diff --git a/.github/workflows/linux-flatpak-build.yml b/.github/workflows/linux-flatpak-build.yml index debef9eee..5f3162099 100644 --- a/.github/workflows/linux-flatpak-build.yml +++ b/.github/workflows/linux-flatpak-build.yml @@ -59,21 +59,21 @@ jobs: - name: Generate AppStream XML run: | - scripts/generate-metainfo.sh scripts/flatpak - cat scripts/flatpak/org.duckstation.DuckStation.metainfo.xml + scripts/packaging/generate-metainfo.sh scripts/packaging/flatpak + cat scripts/packaging/flatpak/org.duckstation.DuckStation.metainfo.xml - name: Validate AppStream XML - run: flatpak-builder-lint appstream scripts/flatpak/org.duckstation.DuckStation.metainfo.xml + run: flatpak-builder-lint appstream scripts/packaging/flatpak/org.duckstation.DuckStation.metainfo.xml - name: Validate Manifest - run: flatpak-builder-lint manifest scripts/flatpak/org.duckstation.DuckStation.yaml + run: flatpak-builder-lint manifest scripts/packaging/flatpak/org.duckstation.DuckStation.yaml - name: Build Flatpak uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8 with: bundle: duckstation-x64.flatpak upload-artifact: false - manifest-path: scripts/flatpak/org.duckstation.DuckStation.yaml + manifest-path: scripts/packaging/flatpak/org.duckstation.DuckStation.yaml arch: x86_64 build-bundle: true verbose: true @@ -81,7 +81,7 @@ jobs: branch: stable cache: true restore-cache: true - cache-key: flatpak-x64-${{ hashFiles('scripts/flatpak/**/*.yaml') }} + cache-key: flatpak-x64-${{ hashFiles('scripts/packaging/flatpak/**/*.yaml') }} - name: Validate Build run: | diff --git a/scripts/clang-toolchain.cmake b/scripts/clang-toolchain.cmake deleted file mode 100644 index 7a601d668..000000000 --- a/scripts/clang-toolchain.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(CMAKE_C_COMPILER /usr/bin/clang-16) -set(CMAKE_CXX_COMPILER /usr/bin/clang++-16) -set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld") -set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld") -set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld") diff --git a/scripts/appimage/apprun-hooks/default-to-x11.sh b/scripts/packaging/appimage/apprun-hooks/default-to-x11.sh similarity index 100% rename from scripts/appimage/apprun-hooks/default-to-x11.sh rename to scripts/packaging/appimage/apprun-hooks/default-to-x11.sh diff --git a/scripts/appimage/install-packages.sh b/scripts/packaging/appimage/install-packages.sh similarity index 100% rename from scripts/appimage/install-packages.sh rename to scripts/packaging/appimage/install-packages.sh diff --git a/scripts/appimage/make-appimage.sh b/scripts/packaging/appimage/make-appimage.sh similarity index 97% rename from scripts/appimage/make-appimage.sh rename to scripts/packaging/appimage/make-appimage.sh index 76333214c..96f417150 100755 --- a/scripts/appimage/make-appimage.sh +++ b/scripts/packaging/appimage/make-appimage.sh @@ -127,8 +127,8 @@ DEPLOY_PLATFORM_THEMES="1" \ QMAKE="$DEPSDIR/bin/qmake" \ NO_STRIP="1" \ $LINUXDEPLOY --plugin qt --appdir="$OUTDIR" --executable="$BUILDDIR/bin/duckstation-qt" ${EXTRA_LIBS_ARGS[@]} \ ---desktop-file="$ROOTDIR/scripts/org.duckstation.DuckStation.desktop" \ ---icon-file="$ROOTDIR/scripts/org.duckstation.DuckStation.png" \ +--desktop-file="$ROOTDIR/scripts/packaging/org.duckstation.DuckStation.desktop" \ +--icon-file="$ROOTDIR/scripts/packaging/org.duckstation.DuckStation.png" \ echo "Copying resources into AppDir..." cp -a "$BUILDDIR/bin/resources" "$OUTDIR/usr/bin" diff --git a/scripts/flatpak/.gitignore b/scripts/packaging/flatpak/.gitignore similarity index 100% rename from scripts/flatpak/.gitignore rename to scripts/packaging/flatpak/.gitignore diff --git a/scripts/flatpak/modules/10-libbacktrace.yaml b/scripts/packaging/flatpak/modules/10-libbacktrace.yaml similarity index 100% rename from scripts/flatpak/modules/10-libbacktrace.yaml rename to scripts/packaging/flatpak/modules/10-libbacktrace.yaml diff --git a/scripts/flatpak/modules/11-libzip.yaml b/scripts/packaging/flatpak/modules/11-libzip.yaml similarity index 100% rename from scripts/flatpak/modules/11-libzip.yaml rename to scripts/packaging/flatpak/modules/11-libzip.yaml diff --git a/scripts/flatpak/modules/20-sdl2.yaml b/scripts/packaging/flatpak/modules/20-sdl2.yaml similarity index 100% rename from scripts/flatpak/modules/20-sdl2.yaml rename to scripts/packaging/flatpak/modules/20-sdl2.yaml diff --git a/scripts/flatpak/modules/21-shaderc.yaml b/scripts/packaging/flatpak/modules/21-shaderc.yaml similarity index 100% rename from scripts/flatpak/modules/21-shaderc.yaml rename to scripts/packaging/flatpak/modules/21-shaderc.yaml diff --git a/scripts/flatpak/modules/22-spirv-cross.yaml b/scripts/packaging/flatpak/modules/22-spirv-cross.yaml similarity index 100% rename from scripts/flatpak/modules/22-spirv-cross.yaml rename to scripts/packaging/flatpak/modules/22-spirv-cross.yaml diff --git a/scripts/flatpak/modules/23-cpuinfo.yaml b/scripts/packaging/flatpak/modules/23-cpuinfo.yaml similarity index 100% rename from scripts/flatpak/modules/23-cpuinfo.yaml rename to scripts/packaging/flatpak/modules/23-cpuinfo.yaml diff --git a/scripts/flatpak/modules/24-discord-rpc.yaml b/scripts/packaging/flatpak/modules/24-discord-rpc.yaml similarity index 100% rename from scripts/flatpak/modules/24-discord-rpc.yaml rename to scripts/packaging/flatpak/modules/24-discord-rpc.yaml diff --git a/scripts/flatpak/modules/25-soundtouch.yaml b/scripts/packaging/flatpak/modules/25-soundtouch.yaml similarity index 100% rename from scripts/flatpak/modules/25-soundtouch.yaml rename to scripts/packaging/flatpak/modules/25-soundtouch.yaml diff --git a/scripts/flatpak/modules/26-lunasvg.yaml b/scripts/packaging/flatpak/modules/26-lunasvg.yaml similarity index 100% rename from scripts/flatpak/modules/26-lunasvg.yaml rename to scripts/packaging/flatpak/modules/26-lunasvg.yaml diff --git a/scripts/flatpak/org.duckstation.DuckStation.yaml b/scripts/packaging/flatpak/org.duckstation.DuckStation.yaml similarity index 90% rename from scripts/flatpak/org.duckstation.DuckStation.yaml rename to scripts/packaging/flatpak/org.duckstation.DuckStation.yaml index cf66b339e..0be7574fb 100644 --- a/scripts/flatpak/org.duckstation.DuckStation.yaml +++ b/scripts/packaging/flatpak/org.duckstation.DuckStation.yaml @@ -80,21 +80,21 @@ modules: - "-DCMAKE_SHARED_LINKER_FLAGS_INIT=-fuse-ld=lld" sources: - type: dir - path: ../.. + path: ../../.. post-install: # Manually copy desktop file/metadata, it's not done as part of the regular build. - >- install -Dm644 - "${FLATPAK_BUILDER_BUILDDIR}/scripts/org.duckstation.DuckStation.png" + "${FLATPAK_BUILDER_BUILDDIR}/scripts/packaging/org.duckstation.DuckStation.png" "${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/org.duckstation.DuckStation.png" - >- install -Dm644 - "${FLATPAK_BUILDER_BUILDDIR}/scripts/org.duckstation.DuckStation.desktop" + "${FLATPAK_BUILDER_BUILDDIR}/scripts/packaging/org.duckstation.DuckStation.desktop" "${FLATPAK_DEST}/share/applications/org.duckstation.DuckStation.desktop" - >- install -Dm644 - "${FLATPAK_BUILDER_BUILDDIR}/scripts/flatpak/org.duckstation.DuckStation.metainfo.xml" + "${FLATPAK_BUILDER_BUILDDIR}/scripts/packaging/flatpak/org.duckstation.DuckStation.metainfo.xml" "${FLATPAK_DEST}/share/metainfo/org.duckstation.DuckStation.metainfo.xml" # Ensure ffmpeg-full mount point exists. diff --git a/scripts/generate-metainfo.sh b/scripts/packaging/generate-metainfo.sh similarity index 100% rename from scripts/generate-metainfo.sh rename to scripts/packaging/generate-metainfo.sh diff --git a/scripts/org.duckstation.DuckStation.desktop b/scripts/packaging/org.duckstation.DuckStation.desktop similarity index 100% rename from scripts/org.duckstation.DuckStation.desktop rename to scripts/packaging/org.duckstation.DuckStation.desktop diff --git a/scripts/org.duckstation.DuckStation.metainfo.xml.in b/scripts/packaging/org.duckstation.DuckStation.metainfo.xml.in similarity index 100% rename from scripts/org.duckstation.DuckStation.metainfo.xml.in rename to scripts/packaging/org.duckstation.DuckStation.metainfo.xml.in diff --git a/scripts/org.duckstation.DuckStation.png b/scripts/packaging/org.duckstation.DuckStation.png similarity index 100% rename from scripts/org.duckstation.DuckStation.png rename to scripts/packaging/org.duckstation.DuckStation.png