diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d308ad..838cade 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,17 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} build-installer: - runs-on: windows-2025 + runs-on: windows-${{ matrix.image }} + strategy: + fail-fast: false + matrix: + include: + - msystem: CLANGARM64 + arch_name: arm64 + image: 11-arm + - msystem: CLANG64 + arch_name: x86_64 + image: 2022 steps: - name: Checkout code uses: actions/checkout@v4 @@ -41,7 +51,7 @@ jobs: - name: setup-msys2 uses: msys2/setup-msys2@v2 # zizmor: ignore[unpinned-uses] with: - msystem: CLANG64 + msystem: ${{ matrix.msystem }} update: true install: >- tar @@ -69,18 +79,20 @@ jobs: - name: Create 'latest' Variants and Checksums run: | - mv msys2-base-x86_64-[0-9]*.sfx.exe msys2-base-x86_64-latest.sfx.exe - mv msys2-x86_64-[0-9]*.exe msys2-x86_64-latest.exe - mv msys2-*.tar.xz msys2-base-x86_64-latest.tar.xz - mv msys2-*.tar.zst msys2-base-x86_64-latest.tar.zst - mv msys2-*.packages.txt msys2-base-x86_64-latest.packages.txt + mv msys2-base-${{ matrix.arch_name }}-[0-9]*.sfx.exe msys2-base-${{ matrix.arch_name }}-latest.sfx.exe + mv msys2-${{ matrix.arch_name }}-[0-9]*.exe msys2-${{ matrix.arch_name }}-latest.exe + if ("${{ matrix.arch_name }}" -ne "arm64") { + mv msys2-*.tar.xz msys2-base-${{ matrix.arch_name }}-latest.tar.xz + mv msys2-*.tar.zst msys2-base-${{ matrix.arch_name }}-latest.tar.zst + } + mv msys2-*.packages.txt msys2-base-${{ matrix.arch_name }}-latest.packages.txt sha256sum.exe msys2-* - sha256sum.exe msys2-* > msys2-checksums.txt + sha256sum.exe msys2-* > msys2-${{ matrix.arch_name }}-checksums.txt - name: Upload Results uses: actions/upload-artifact@v4 with: - name: installer + name: installer-${{ matrix.arch_name }} path: msys2-* test-installer: @@ -90,7 +102,13 @@ jobs: strategy: fail-fast: false matrix: - image: [2022, 2025] + include: + - arch_name: arm64 + image: 11-arm + - arch_name: x86_64 + image: 2022 + - arch_name: x86_64 + image: 2025 steps: - name: Checkout code uses: actions/checkout@v4 @@ -99,11 +117,11 @@ jobs: - uses: actions/download-artifact@v4 with: - name: installer + name: installer-${{ matrix.arch_name }} - name: Install run: | - ./msys2-x86_64-latest.exe in --confirm-command --accept-messages --root C:/msys2-install-test + ./msys2-${{ matrix.arch_name }}-latest.exe in --confirm-command --accept-messages --root C:/msys2-install-test - name: Test without Login Shell run: | @@ -137,7 +155,7 @@ jobs: - uses: actions/download-artifact@v4 with: - name: installer + name: installer-x86_64 - name: Build image run: | @@ -163,7 +181,13 @@ jobs: strategy: fail-fast: false matrix: - image: [2022, 2025, 11-arm] + include: + - arch_name: arm64 + image: 11-arm + - arch_name: x86_64 + image: 2022 + - arch_name: x86_64 + image: 2025 steps: - name: Checkout code uses: actions/checkout@v4 @@ -172,11 +196,11 @@ jobs: - uses: actions/download-artifact@v4 with: - name: installer + name: installer-${{ matrix.arch_name }} - name: Install run: | - ./msys2-base-x86_64-latest.sfx.exe -y -oC:/msys2-install-test + ./msys2-base-${{ matrix.arch_name }}-latest.sfx.exe -y -oC:/msys2-install-test - name: Test without Login Shell run: | @@ -207,7 +231,11 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: installer + name: installer-x86_64 + + - uses: actions/download-artifact@v4 + with: + name: installer-arm64 - name: Upload Installers env: diff --git a/create-sfx.sh b/create-sfx.sh index 9c53313..aebb074 100755 --- a/create-sfx.sh +++ b/create-sfx.sh @@ -3,9 +3,16 @@ set -e +if [ "$MSYSTEM" = "CLANGARM64" ]; then + ARCH="arm64" + CHECKSUM="c526e8c6cb5dc0d175778f1b6b67bd1571ba8a2cf6f6b36b7c8a8d3197ad2bac" +else + ARCH="x64" + CHECKSUM="d140094f0277b49a4e895159bd734da03cd2b60fb73a65e4151edfedc612981e" +fi + # Download and extract https://github.com/mcmilk/7-Zip-zstd -NAME="7z25.01-zstd-x64" -CHECKSUM="d140094f0277b49a4e895159bd734da03cd2b60fb73a65e4151edfedc612981e" +NAME="7z25.01-zstd-${ARCH}" DIR="$( cd "$( dirname "$0" )" && pwd )" mkdir -p "$DIR/_cache" BASE="$DIR/_cache/$NAME" @@ -17,7 +24,7 @@ if [ ! -d "$BASE" ]; then 7z e -o"$BASE" "$DIR/_cache/$NAME.exe" fi -# Creat SFX installer +# Create SFX installer INPUT="$1" OUTPUT="$2" TEMP="$OUTPUT.payload" @@ -25,4 +32,4 @@ TEMP="$OUTPUT.payload" rm -f "$TEMP" "$BASE/7z" a "$TEMP" -ms1T -m0=zstd -mx22 "$INPUT" cat "$BASE/7zCon.sfx" "$TEMP" > "$OUTPUT" -rm "$TEMP" +rm "$TEMP" \ No newline at end of file diff --git a/make-msys2-installer b/make-msys2-installer index 83f32e4..80bbc94 100644 --- a/make-msys2-installer +++ b/make-msys2-installer @@ -11,6 +11,12 @@ _version="${_date}" _newmsysbase="${_build}/newmsys" _newmsys="${_newmsysbase}/msys64" +if [ "$MSYSTEM" = "CLANGARM64" ]; then + _arch_name="arm64" +else + _arch_name="x86_64" +fi + create_installer_archive() { echo "[Creating installer archive...]" @@ -24,25 +30,25 @@ create_installer_archive() { create_archives() { echo "[Creating tarball...]" pushd "${_newmsysbase}" > /dev/null - /usr/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cf "${_thisdir}/msys2-base-x86_64-${_date}.tar" msys64 + /usr/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cf "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar" msys64 popd > /dev/null echo "[Creating xz archive...]" - xz -9 --keep --verbose --force --compress --threads=0 "${_thisdir}/msys2-base-x86_64-${_date}.tar" - xz --test "${_thisdir}/msys2-base-x86_64-${_date}.tar.xz" + xz -9 --keep --verbose --force --compress --threads=0 "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar" + xz --test "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar.xz" echo "[Creating zstd archive...]" - zstd -T0 -22 --ultra --force "${_thisdir}/msys2-base-x86_64-${_date}.tar" -o "${_thisdir}/msys2-base-x86_64-${_date}.tar.zst" - zstd --test "${_thisdir}/msys2-base-x86_64-${_date}.tar.zst" + zstd -T0 -22 --ultra --force "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar" -o "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar.zst" + zstd --test "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar.zst" - rm "${_thisdir}/msys2-base-x86_64-${_date}.tar" + rm "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar" } create_sfx() { echo "[Creating SFX...]" pushd "${_newmsysbase}" > /dev/null - "${_thisdir}/create-sfx.sh" "msys64" "${_thisdir}/msys2-base-x86_64-${_date}.sfx.exe" + "${_thisdir}/create-sfx.sh" "msys64" "${_thisdir}/msys2-base-${_arch_name}-${_date}.sfx.exe" popd > /dev/null } @@ -63,7 +69,7 @@ create_installer() { -p "${_ifwroot}/packages" \ -c "${_ifwroot}/config/config.xml" \ --offline-only \ - "${_thisdir}/msys2-x86_64-${_date}.exe" \ + "${_thisdir}/msys2-${_arch_name}-${_date}.exe" \ -v popd > /dev/null } @@ -80,7 +86,7 @@ create_chroot_system() { pacman -Syu --root "${_newmsys}" pacman -S filesystem msys2-runtime --noconfirm --root "${_newmsys}" pacman -S base --noconfirm --root "${_newmsys}" - pacman -Q --root "${_newmsys}" > "${_thisdir}/msys2-base-x86_64-${_date}.packages.txt" + pacman -Q --root "${_newmsys}" > "${_thisdir}/msys2-base-${_arch_name}-${_date}.packages.txt" popd > /dev/null } @@ -98,7 +104,9 @@ main() { create_installer_archive create_installer - create_archives + if [ "$_arch_name" != "arm64" ]; then + create_archives + fi create_sfx }