diff --git a/.github/workflows/generate_appcast.yml b/.github/workflows/generate_appcast.yml index e8f2c621d2..04483f59bb 100644 --- a/.github/workflows/generate_appcast.yml +++ b/.github/workflows/generate_appcast.yml @@ -110,15 +110,15 @@ jobs: - name: Deploy appcast to Cloudflare KV if: github.event_name == 'release' env: - CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} - CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} - KV_NAMESPACE_ID: ${{ secrets.CF_KV_NAMESPACE_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_KV_APPCAST_ID }} run: | - if [ -n "$CF_API_TOKEN" ] && [ -n "$CF_ACCOUNT_ID" ] && [ -n "$KV_NAMESPACE_ID" ]; then + if [ -n "$CLOUDFLARE_API_TOKEN" ] && [ -n "$CLOUDFLARE_ACCOUNT_ID" ] && [ -n "$KV_NAMESPACE_ID" ]; then # Deploy appcast.xml curl -X PUT \ - "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/storage/kv/namespaces/$KV_NAMESPACE_ID/values/appcast.xml" \ - -H "Authorization: Bearer $CF_API_TOKEN" \ + "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/storage/kv/namespaces/$KV_NAMESPACE_ID/values/appcast.xml" \ + -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -H "Content-Type: text/plain" \ --data-binary @appcast.xml echo "Appcast deployed to Cloudflare KV" @@ -127,8 +127,8 @@ jobs: if [ -n "${{ steps.signatures.outputs.mac_signature }}" ]; then echo "${{ steps.signatures.outputs.mac_signature }}" > mac_signature.txt curl -X PUT \ - "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/storage/kv/namespaces/$KV_NAMESPACE_ID/values/signatures/${{ steps.version.outputs.version }}/mac.sig" \ - -H "Authorization: Bearer $CF_API_TOKEN" \ + "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/storage/kv/namespaces/$KV_NAMESPACE_ID/values/signatures/${{ steps.version.outputs.version }}/mac.sig" \ + -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -H "Content-Type: text/plain" \ --data-binary @mac_signature.txt echo "macOS signature deployed to Cloudflare KV" diff --git a/src/slic3r/GUI/UpdateManagerMac.mm b/src/slic3r/GUI/UpdateManagerMac.mm index 9c0efed746..9c74678844 100644 --- a/src/slic3r/GUI/UpdateManagerMac.mm +++ b/src/slic3r/GUI/UpdateManagerMac.mm @@ -1,4 +1,5 @@ #include "UpdateManager.hpp" +#include "libslic3r/libslic3r.h" #ifdef __APPLE__ @@ -12,18 +13,10 @@ // macOS Implementation (Sparkle 2) // ============================================================================ -namespace Slic3r { -namespace GUI { - -// Static member definitions (defined in UpdateManager.cpp for other platforms) -// For macOS, we need to define them here since UpdateManagerMac.mm is compiled instead -bool UpdateManager::s_initialized = false; -std::string UpdateManager::s_appcast_url; -std::string UpdateManager::s_public_key; - #ifdef ORCA_HAS_SPARKLE // Sparkle updater delegate for custom behavior +// NOTE: Objective-C declarations must be at global scope (outside C++ namespaces) @interface OrcaSparkleDelegate : NSObject @end @@ -69,6 +62,19 @@ std::string UpdateManager::s_public_key; static SPUStandardUpdaterController *s_updater_controller = nil; static OrcaSparkleDelegate *s_updater_delegate = nil; +#endif // ORCA_HAS_SPARKLE + +namespace Slic3r { +namespace GUI { + +// Static member definitions (defined in UpdateManager.cpp for other platforms) +// For macOS, we need to define them here since UpdateManagerMac.mm is compiled instead +bool UpdateManager::s_initialized = false; +std::string UpdateManager::s_appcast_url; +std::string UpdateManager::s_public_key; + +#ifdef ORCA_HAS_SPARKLE + void UpdateManager::init(const std::string& appcast_url, const std::string& public_key) { if (s_initialized) {