diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 263a924e46b0b..2436809a5c0c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,22 +154,6 @@ jobs: shell: bash run: pnpm run build:arm64 - - name: Convert X64 AppImage to static runtime - if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64') - shell: bash - env: - VERSION: ${{ steps.versionNumber.outputs.version }} - run: | - sudo apt install desktop-file-utils - cd build - appimage="FreeTube-${VERSION}.AppImage" - wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O ./appimagetool.AppImage - chmod +x ./"$appimage" ./appimagetool.AppImage - ./"$appimage" --appimage-extract && rm -f ./"$appimage" - ./appimagetool.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ - -n ./squashfs-root ./"$appimage" - rm -rf ./squashfs-root ./appimagetool.AppImage - - name: Upload Linux .zip x64 Artifact uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1 if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55991171c0294..2c02eaa820243 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,12 +35,15 @@ jobs: include: - runtime: linux-x64 os: ubuntu-latest + appimage-arch: amd64 - runtime: linux-armv7l os: ubuntu-latest + appimage-arch: armv7l - runtime: linux-arm64 os: ubuntu-latest + appimage-arch: arm64 - runtime: osx-x64 os: macOS-latest @@ -107,58 +110,24 @@ jobs: shell: bash run: pnpm run build:arm64 - - name: Convert X64 AppImage to static runtime and add update information - if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64') - shell: bash - env: - VERSION: ${{ steps.getPackageInfo.outputs.version }} - run: | - sudo apt install desktop-file-utils - cd build - appimage="FreeTube-${VERSION}.AppImage" - wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O ./appimagetool.AppImage - chmod +x ./"$appimage" ./appimagetool.AppImage - update_information='gh-releases-zsync|FreeTubeApp|FreeTube|latest-all|freetube-*-amd64.AppImage.zsync' - ./"$appimage" --appimage-extract && rm -f ./"$appimage" - ./appimagetool.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ - -u "$update_information" -n ./squashfs-root ./"$appimage" - rm -rf ./squashfs-root ./appimagetool.AppImage - - - name: Convert ARMv7l AppImage to static runtime and add update information - if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l') - shell: bash - env: - VERSION: ${{ steps.getPackageInfo.outputs.version }} - run: | - sudo apt install desktop-file-utils - cd build - appimage="FreeTube-${VERSION}-armv7l.AppImage" - wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O ./appimagetool.AppImage - wget "https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64" -O runtime - chmod +x ./"$appimage" ./appimagetool.AppImage ./runtime - update_information='gh-releases-zsync|FreeTubeApp|FreeTube|latest-all|freetube-*-armv7l.AppImage.zsync' - TARGET_APPIMAGE="$appimage" ./runtime --appimage-extract && rm -f ./"$appimage" - ARCH=armhf ./appimagetool.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ - -u "$update_information" -n ./squashfs-root ./"$appimage" - rm -rf ./squashfs-root ./appimagetool.AppImage ./runtime - - - name: Convert ARM64 AppImage to static runtime and add update information - if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64') + - name: Add update information to AppImage + if: startsWith(matrix.os, 'ubuntu') shell: bash env: VERSION: ${{ steps.getPackageInfo.outputs.version }} + APPIMAGE_ARCH: ${{ matrix.appimage-arch }} run: | - sudo apt install desktop-file-utils + update_info="gh-releases-zsync|FreeTubeApp|FreeTube|latest-all|freetube-*-${APPIMAGE_ARCH}.AppImage.zsync" + cd build - appimage="FreeTube-${VERSION}-arm64.AppImage" - wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O ./appimagetool.AppImage - wget "https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64" -O runtime - chmod +x ./"$appimage" ./appimagetool.AppImage ./runtime - update_information='gh-releases-zsync|FreeTubeApp|FreeTube|latest-all|freetube-*-arm64.AppImage.zsync' - TARGET_APPIMAGE="$appimage" ./runtime --appimage-extract && rm -f ./"$appimage" - ARCH=aarch64 ./appimagetool.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ - -u "$update_information" -n ./squashfs-root ./"$appimage" - rm -rf ./squashfs-root ./appimagetool.AppImage ./runtime + + section_offset_hex="$(objdump --section-headers ./FreeTube-${VERSION}*.AppImage | awk '$2 == ".upd_info" { printf $6 }')" + + script='const fd = fs.openSync(process.argv[3], "r+"); fs.writeSync(fd, process.argv[2], parseInt(process.argv[1], 16)); fs.closeSync(fd)' + + node -e "$script" $section_offset_hex "$update_info" ./FreeTube-${VERSION}*.AppImage + + zsyncmake -u "freetube-${VERSION}-beta-${APPIMAGE_ARCH}.AppImage" ./FreeTube-${VERSION}*.AppImage - name: Upload Linux .zip x64 Release uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2 diff --git a/_scripts/ebuilder.config.mjs b/_scripts/ebuilder.config.mjs index a1c5eb318cad7..0953909512335 100644 --- a/_scripts/ebuilder.config.mjs +++ b/_scripts/ebuilder.config.mjs @@ -73,6 +73,9 @@ export default { 'libsecret-1-0' ] }, + toolsets: { + appimage: '1.0.3' + }, mac: { category: 'public.app-category.utilities', icon: '_icons/iconMac.icns',