From 7c2b3f8c8d738e583006d5c7716f15ff9989813d Mon Sep 17 00:00:00 2001 From: dijunkun Date: Wed, 3 Sep 2025 17:10:17 +0800 Subject: [PATCH] [fix] use x64 and amd64 instead of x86_64 in artifact name --- .github/workflows/build.yaml | 35 ++++++------ .github/workflows/update-pages.yaml | 6 +- scripts/linux/{pkg_x86_64.sh => pkg_amd64.sh} | 2 +- scripts/linux/pkg_arm64.sh | 56 ++++++++++--------- scripts/macosx/{pkg_x86_64.sh => pkg_x64.sh} | 4 +- scripts/windows/nsis_script.nsi | 2 +- 6 files changed, 54 insertions(+), 51 deletions(-) rename scripts/linux/{pkg_x86_64.sh => pkg_amd64.sh} (97%) rename scripts/macosx/{pkg_x86_64.sh => pkg_x64.sh} (96%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index aa9a173..fd54c92 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,9 +15,9 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: - # Linux x86_64 - build-linux-x86_64: - name: Build on Ubuntu 22.04 x86_64 + # Linux amd64 + build-linux-amd64: + name: Build on Ubuntu 22.04 amd64 runs-on: ubuntu-22.04 container: image: crossdesk/ubuntu22.04:latest @@ -62,14 +62,14 @@ jobs: - name: Package run: | - chmod +x ./scripts/linux/pkg_x86_64.sh - ./scripts/linux/pkg_x86_64.sh ${LEGAL_VERSION} + chmod +x ./scripts/linux/pkg_amd64.sh + ./scripts/linux/pkg_amd64.sh ${LEGAL_VERSION} - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: crossdesk-linux-x86_64-${{ env.LEGAL_VERSION }} - path: ${{ github.workspace }}/crossdesk-linux-x86_64-${{ env.LEGAL_VERSION }}.deb + name: crossdesk-linux-amd64-${{ env.LEGAL_VERSION }} + path: ${{ github.workspace }}/crossdesk-linux-amd64-${{ env.LEGAL_VERSION }}.deb # Linux arm64 build-linux-arm64: @@ -139,11 +139,11 @@ jobs: strategy: matrix: include: - - arch: x86_64 + - arch: x64 runner: macos-13 cache-key: intel out-dir: ./build/macosx/x86_64/release/crossdesk - package_script: ./scripts/macosx/pkg_x86_64.sh + package_script: ./scripts/macosx/pkg_x64.sh - arch: arm64 runner: macos-14 cache-key: arm @@ -202,8 +202,8 @@ jobs: cp crossdesk-macos-${{ matrix.arch }}-${{ env.VERSION_NUM }}.pkg release/ # Windows - build-windows: - name: Build on Windows + build-windows-x64: + name: Build on Windows x64 runs-on: windows-2022 env: XMAKE_GLOBALDIR: D:\xmake_global @@ -279,13 +279,14 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: crossdesk-win-x86_64-${{ env.VERSION_NUM }} - path: ${{ github.workspace }}/scripts/windows/crossdesk-win-x86_64-${{ env.VERSION_NUM }}.exe + name: crossdesk-win-x64-${{ env.VERSION_NUM }} + path: ${{ github.workspace }}/scripts/windows/crossdesk-win-x64-${{ env.VERSION_NUM }}.exe release: name: Publish Release if: startsWith(github.ref, 'refs/tags/v') - needs: [build-linux-x86_64, build-linux-arm64, build-macos, build-windows] + needs: + [build-linux-amd64, build-linux-arm64, build-macos, build-windows-x64] runs-on: ubuntu-latest steps: @@ -307,11 +308,11 @@ jobs: - name: Rename artifacts run: | mkdir -p release - cp artifacts/crossdesk-macos-x86_64-${{ steps.version.outputs.VERSION_NUM }}/* release/crossdesk-macos-x86_64-${{ steps.version.outputs.VERSION_NUM }}.pkg + cp artifacts/crossdesk-macos-x64-${{ steps.version.outputs.VERSION_NUM }}/* release/crossdesk-macos-x64-${{ steps.version.outputs.VERSION_NUM }}.pkg cp artifacts/crossdesk-macos-arm64-${{ steps.version.outputs.VERSION_NUM }}/* release/crossdesk-macos-arm64-${{ steps.version.outputs.VERSION_NUM }}.pkg - cp artifacts/crossdesk-linux-x86_64-${{ steps.version.outputs.VERSION_NUM }}/* release/crossdesk-linux-x86_64-${{ steps.version.outputs.VERSION_NUM }}.deb + cp artifacts/crossdesk-linux-amd64-${{ steps.version.outputs.VERSION_NUM }}/* release/crossdesk-linux-amd64-${{ steps.version.outputs.VERSION_NUM }}.deb cp artifacts/crossdesk-linux-arm64-${{ steps.version.outputs.VERSION_NUM }}/* release/crossdesk-linux-arm64-${{ steps.version.outputs.VERSION_NUM }}.deb - cp artifacts/crossdesk-win-x86_64-${{ steps.version.outputs.VERSION_NUM }}/* release/crossdesk-win-x86_64-${{ steps.version.outputs.VERSION_NUM }}.exe + cp artifacts/crossdesk-win-x64-${{ steps.version.outputs.VERSION_NUM }}/* release/crossdesk-win-x64-${{ steps.version.outputs.VERSION_NUM }}.exe - name: List release files run: ls -lh release/ diff --git a/.github/workflows/update-pages.yaml b/.github/workflows/update-pages.yaml index 2332846..3183c74 100644 --- a/.github/workflows/update-pages.yaml +++ b/.github/workflows/update-pages.yaml @@ -30,10 +30,10 @@ jobs: - name: Update download links run: | cd pages - sed -E -i "s/crossdesk-win-x86_64-[0-9]+\.[0-9]+\.[0-9]+\.exe/crossdesk-win-x86_64-${VERSION_NUM}.exe/g" index.html - sed -E -i "s/crossdesk-macos-x86_64-[0-9]+\.[0-9]+\.[0-9]+\.pkg/crossdesk-macos-x86_64-${VERSION_NUM}.pkg/g" index.html + sed -E -i "s/crossdesk-win-x64-[0-9]+\.[0-9]+\.[0-9]+\.exe/crossdesk-win-x64-${VERSION_NUM}.exe/g" index.html + sed -E -i "s/crossdesk-macos-x64-[0-9]+\.[0-9]+\.[0-9]+\.pkg/crossdesk-macos-x64-${VERSION_NUM}.pkg/g" index.html sed -E -i "s/crossdesk-macos-arm64-[0-9]+\.[0-9]+\.[0-9]+\.pkg/crossdesk-macos-arm64-${VERSION_NUM}.pkg/g" index.html - sed -E -i "s/crossdesk-linux-x86_64-[0-9]+\.[0-9]+\.[0-9]+\.deb/crossdesk-linux-x86_64-${VERSION_NUM}.deb/g" index.html + sed -E -i "s/crossdesk-linux-amd64-[0-9]+\.[0-9]+\.[0-9]+\.deb/crossdesk-linux-amd64-${VERSION_NUM}.deb/g" index.html sed -E -i "s/crossdesk-linux-arm64-[0-9]+\.[0-9]+\.[0-9]+\.deb/crossdesk-linux-arm64-${VERSION_NUM}.deb/g" index.html - name: Commit & Push changes diff --git a/scripts/linux/pkg_x86_64.sh b/scripts/linux/pkg_amd64.sh similarity index 97% rename from scripts/linux/pkg_x86_64.sh rename to scripts/linux/pkg_amd64.sh index 84edc77..e6dc0b1 100644 --- a/scripts/linux/pkg_x86_64.sh +++ b/scripts/linux/pkg_amd64.sh @@ -111,7 +111,7 @@ chmod +x "$DEBIAN_DIR/postinst" dpkg-deb --build "$DEB_DIR" -OUTPUT_FILE="${PKG_NAME}-${APP_VERSION}-${ARCHITECTURE}.deb" +OUTPUT_FILE="${PKG_NAME}-linux-${ARCHITECTURE}-${APP_VERSION}.deb" mv "$DEB_DIR.deb" "$OUTPUT_FILE" rm -rf "$DEB_DIR" diff --git a/scripts/linux/pkg_arm64.sh b/scripts/linux/pkg_arm64.sh index 9859e58..cca5d1e 100644 --- a/scripts/linux/pkg_arm64.sh +++ b/scripts/linux/pkg_arm64.sh @@ -1,16 +1,18 @@ #!/bin/bash set -e +PKG_NAME="crossdesk" APP_NAME="CrossDesk" + APP_VERSION="$1" ARCHITECTURE="arm64" MAINTAINER="Junkun Di " DESCRIPTION="A simple cross-platform remote desktop client." -DEB_DIR="$APP_NAME-$APP_VERSION" +DEB_DIR="${PKG_NAME}-${APP_VERSION}" DEBIAN_DIR="$DEB_DIR/DEBIAN" -BIN_DIR="$DEB_DIR/usr/local/bin" -CERT_SRC_DIR="$DEB_DIR/opt/$APP_NAME/certs" +BIN_DIR="$DEB_DIR/usr/bin" +CERT_SRC_DIR="$DEB_DIR/opt/$PKG_NAME/certs" ICON_BASE_DIR="$DEB_DIR/usr/share/icons/hicolor" DESKTOP_DIR="$DEB_DIR/usr/share/applications" @@ -19,18 +21,20 @@ rm -rf "$DEB_DIR" mkdir -p "$DEBIAN_DIR" "$BIN_DIR" "$CERT_SRC_DIR" "$DESKTOP_DIR" cp build/linux/arm64/release/crossdesk "$BIN_DIR" +chmod +x "$BIN_DIR/$PKG_NAME" + +ln -s "$PKG_NAME" "$BIN_DIR/$APP_NAME" + cp certs/crossdesk.cn_root.crt "$CERT_SRC_DIR/crossdesk.cn_root.crt" for size in 16 24 32 48 64 96 128 256; do mkdir -p "$ICON_BASE_DIR/${size}x${size}/apps" cp "icons/linux/crossdesk_${size}x${size}.png" \ - "$ICON_BASE_DIR/${size}x${size}/apps/crossdesk.png" + "$ICON_BASE_DIR/${size}x${size}/apps/${PKG_NAME}.png" done -chmod +x "$BIN_DIR/crossdesk" - cat > "$DEBIAN_DIR/control" << EOF -Package: $APP_NAME +Package: $PKG_NAME Version: $APP_VERSION Architecture: $ARCHITECTURE Maintainer: $MAINTAINER @@ -43,13 +47,13 @@ Priority: optional Section: utils EOF -cat > "$DESKTOP_DIR/$APP_NAME.desktop" << EOF +cat > "$DESKTOP_DIR/$PKG_NAME.desktop" << EOF [Desktop Entry] Version=$APP_VERSION Name=$APP_NAME Comment=$DESCRIPTION -Exec=/usr/local/bin/crossdesk -Icon=crossdesk +Exec=/usr/bin/$PKG_NAME +Icon=$PKG_NAME Terminal=false Type=Application Categories=Utility; @@ -57,50 +61,48 @@ EOF cat > "$DEBIAN_DIR/postrm" << EOF #!/bin/bash -# post-removal script for $APP_NAME - set -e if [ "\$1" = "remove" ] || [ "\$1" = "purge" ]; then - rm -f /usr/local/bin/crossdesk - rm -f /usr/share/applications/$APP_NAME.desktop - rm -rf /opt/$APP_NAME + rm -f /usr/bin/$PKG_NAME || true + rm -f /usr/bin/$APP_NAME || true + rm -f /usr/share/applications/$PKG_NAME.desktop || true + rm -rf /opt/$PKG_NAME/certs || true for size in 16 24 32 48 64 96 128 256; do - rm -f /usr/share/icons/hicolor/\${size}x\${size}/apps/crossdesk.png + rm -f /usr/share/icons/hicolor/\${size}x\${size}/apps/$PKG_NAME.png || true done fi exit 0 EOF - chmod +x "$DEBIAN_DIR/postrm" cat > "$DEBIAN_DIR/postinst" << 'EOF' #!/bin/bash set -e -CERT_SRC="/opt/CrossDesk/certs" +CERT_SRC="/opt/crossdesk/certs" CERT_FILE="crossdesk.cn_root.crt" for user_home in /home/*; do [ -d "$user_home" ] || continue username=$(basename "$user_home") - config_dir="$user_home/.config/CrossDesk/certs" + config_dir="$user_home/.config/crossdesk/certs" target="$config_dir/$CERT_FILE" if [ ! -f "$target" ]; then - mkdir -p "$config_dir" - cp "$CERT_SRC/$CERT_FILE" "$target" - chown -R "$username:$username" "$user_home/.config/CrossDesk" + mkdir -p "$config_dir" || true + cp "$CERT_SRC/$CERT_FILE" "$target" || true + chown -R "$username:$username" "$user_home/.config/crossdesk" || true echo "✔ Installed cert for $username at $target" fi done if [ -d "/root" ]; then - config_dir="/root/.config/CrossDesk/certs" - mkdir -p "$config_dir" - cp "$CERT_SRC/$CERT_FILE" "$config_dir/$CERT_FILE" - chown -R root:root /root/.config/CrossDesk + config_dir="/root/.config/crossdesk/certs" + mkdir -p "$config_dir" || true + cp "$CERT_SRC/$CERT_FILE" "$config_dir/$CERT_FILE" || true + chown -R root:root /root/.config/crossdesk || true fi exit 0 @@ -115,4 +117,4 @@ mv "$DEB_DIR.deb" "$OUTPUT_FILE" rm -rf "$DEB_DIR" -echo "Deb package for $OUTPUT_FILE created successfully." \ No newline at end of file +echo "✅ Deb package created: $OUTPUT_FILE" \ No newline at end of file diff --git a/scripts/macosx/pkg_x86_64.sh b/scripts/macosx/pkg_x64.sh similarity index 96% rename from scripts/macosx/pkg_x86_64.sh rename to scripts/macosx/pkg_x64.sh index eead5ce..eccd731 100644 --- a/scripts/macosx/pkg_x86_64.sh +++ b/scripts/macosx/pkg_x64.sh @@ -6,7 +6,7 @@ APP_NAME_UPPER="CrossDesk" EXECUTABLE_PATH="build/macosx/x86_64/release/crossdesk" APP_VERSION="$1" PLATFORM="macos" -ARCH="x86_64" +ARCH="x64" IDENTIFIER="cn.crossdesk.app" ICON_PATH="icons/macos/crossdesk.icns" MACOS_MIN_VERSION="10.12" @@ -29,7 +29,7 @@ rm -rf "${APP_BUNDLE}" "${PKG_NAME}" "${DMG_NAME}" build_pkg_temp CrossDesk_dmg_ mkdir -p build_pkg_temp mkdir -p "${MACOS_DIR}" "${RESOURCES_DIR}" -cp "${EXECUTABLE_PATH}" "${MACOS_DIR}/${APP_NAME_UPPER}" # 拷贝时使用大写的应用名称 +cp "${EXECUTABLE_PATH}" "${MACOS_DIR}/${APP_NAME_UPPER}" chmod +x "${MACOS_DIR}/${APP_NAME_UPPER}" if [ -f "${ICON_PATH}" ]; then diff --git a/scripts/windows/nsis_script.nsi b/scripts/windows/nsis_script.nsi index bfb4b3b..eee110c 100644 --- a/scripts/windows/nsis_script.nsi +++ b/scripts/windows/nsis_script.nsi @@ -37,7 +37,7 @@ RequestExecutionLevel admin ; ------ MUI ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "crossdesk-win-x86_64-${PRODUCT_VERSION}.exe" +OutFile "crossdesk-win-x64-${PRODUCT_VERSION}.exe" InstallDir "$PROGRAMFILES\CrossDesk" ShowInstDetails show