@@ -336,8 +336,18 @@ function upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dic
336
336
results_df:: DataFrame , system_info:: Dict , categories:: Dict )
337
337
338
338
if auth === nothing
339
- @info " ⚠️ No GitHub authentication available. Saving results locally instead of uploading."
340
- # Save locally as fallback
339
+ @info " ⚠️ No GitHub authentication available. Using token-free sharing methods..."
340
+
341
+ # Try token-free sharing methods
342
+ try
343
+ share_results_token_free (content, plot_files, results_df, system_info, categories)
344
+ return
345
+ catch e
346
+ @warn " Token-free sharing failed: $e "
347
+ @info " 📁 Falling back to local save..."
348
+ end
349
+
350
+ # Save locally as final fallback
341
351
fallback_file = " autotune_results_$(replace (string (Dates. now ()), " :" => " -" )) .md"
342
352
open (fallback_file, " w" ) do f
343
353
write (f, content)
@@ -428,6 +438,240 @@ function upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dic
428
438
end
429
439
end
430
440
441
+ """
442
+ share_results_token_free(content, plot_files, results_df, system_info, categories)
443
+
444
+ Share benchmark results without requiring GitHub authentication using various methods.
445
+ """
446
+ function share_results_token_free (content, plot_files, results_df, system_info, categories)
447
+ @info " 🌐 Attempting token-free result sharing methods..."
448
+
449
+ success_methods = String[]
450
+
451
+ # Method 1: Create a shareable gist URL (read-only)
452
+ try
453
+ gist_url = create_anonymous_gist (content, system_info)
454
+ if gist_url != = nothing
455
+ @info " ✅ Anonymous gist created: $gist_url "
456
+ @info " 📋 Share this URL with the LinearSolve.jl community!"
457
+ push! (success_methods, " Anonymous Gist" )
458
+ end
459
+ catch e
460
+ @debug " Anonymous gist creation failed: $e "
461
+ end
462
+
463
+ # Method 2: Generate a formatted email template
464
+ try
465
+ email_content = create_email_template (content, system_info, categories)
466
+ email_file = " benchmark_email_$(replace (string (Dates. now ()), " :" => " -" )) .txt"
467
+ open (email_file, " w" ) do f
468
+ write (f, email_content)
469
+ end
470
+ @info " ✅ Email template created: $email_file "
471
+ @info " 📧 Send this file content to the LinearSolve.jl maintainers!"
472
+ push! (success_methods, " Email Template" )
473
+ catch e
474
+ @debug " Email template creation failed: $e "
475
+ end
476
+
477
+ # Method 3: Generate Discord/Slack sharing format
478
+ try
479
+ discord_content = create_discord_format (content, system_info)
480
+ discord_file = " benchmark_discord_$(replace (string (Dates. now ()), " :" => " -" )) .txt"
481
+ open (discord_file, " w" ) do f
482
+ write (f, discord_content)
483
+ end
484
+ @info " ✅ Discord/Slack format created: $discord_file "
485
+ @info " 💬 Share this in the Julia/LinearSolve community channels!"
486
+ push! (success_methods, " Discord Format" )
487
+ catch e
488
+ @debug " Discord format creation failed: $e "
489
+ end
490
+
491
+ # Method 4: Generate a simple HTTP POST command
492
+ try
493
+ http_command = create_http_post_command (content, system_info)
494
+ http_file = " benchmark_http_$(replace (string (Dates. now ()), " :" => " -" )) .sh"
495
+ open (http_file, " w" ) do f
496
+ write (f, http_command)
497
+ end
498
+ @info " ✅ HTTP POST command created: $http_file "
499
+ @info " 🌐 Run this script to submit via HTTP (when endpoint available)"
500
+ push! (success_methods, " HTTP POST" )
501
+ catch e
502
+ @debug " HTTP POST command creation failed: $e "
503
+ end
504
+
505
+ if ! isempty (success_methods)
506
+ @info " 🎉 Successfully created $(length (success_methods)) sharing methods: $(join (success_methods, " , " )) "
507
+ @info " 🤝 Your benchmark data helps improve LinearSolve.jl for everyone!"
508
+ return true
509
+ else
510
+ return false
511
+ end
512
+ end
513
+
514
+ """
515
+ create_anonymous_gist(content, system_info)
516
+
517
+ Create an anonymous GitHub gist with benchmark results (no auth required).
518
+ """
519
+ function create_anonymous_gist (content, system_info)
520
+ try
521
+ # Create gist payload
522
+ cpu_name = get (system_info, " cpu_name" , " Unknown CPU" )
523
+ os_name = get (system_info, " os" , " Unknown OS" )
524
+ timestamp = Dates. format (Dates. now (), " yyyy-mm-dd" )
525
+
526
+ filename = " linearsolve_benchmark_$(cpu_name) _$(os_name) _$(timestamp) .md"
527
+ # Sanitize filename
528
+ filename = replace (filename, r" [^a-zA-Z0-9._-]" => " _" )
529
+
530
+ gist_data = Dict (
531
+ " description" => " LinearSolve.jl Autotune Benchmark Results - $cpu_name on $os_name " ,
532
+ " public" => true ,
533
+ " files" => Dict (
534
+ filename => Dict (
535
+ " content" => content
536
+ )
537
+ )
538
+ )
539
+
540
+ # Post to GitHub gist API (no auth required for anonymous gists)
541
+ response = HTTP. post (
542
+ " https://api.github.com/gists" ,
543
+ [" Content-Type" => " application/json" ],
544
+ JSON. json (gist_data)
545
+ )
546
+
547
+ if response. status == 201
548
+ result = JSON. parse (String (response. body))
549
+ return result[" html_url" ]
550
+ else
551
+ return nothing
552
+ end
553
+ catch e
554
+ @debug " Anonymous gist creation failed: $e "
555
+ return nothing
556
+ end
557
+ end
558
+
559
+ """
560
+ create_email_template(content, system_info, categories)
561
+
562
+ Create an email template for manual submission to maintainers.
563
+ """
564
+ function create_email_template (content, system_info, categories)
565
+ cpu_name = get (system_info, " cpu_name" , " Unknown CPU" )
566
+ os_name = get (system_info, " os" , " Unknown OS" )
567
+
568
+ template = """
569
+ Subject: LinearSolve.jl Benchmark Results - $cpu_name on $os_name
570
+
571
+ Dear LinearSolve.jl Maintainers,
572
+
573
+ I've run the autotune benchmarks and would like to share the results with the community.
574
+
575
+ $content
576
+
577
+ ---
578
+
579
+ Technical Details:
580
+ - Submitted via: LinearSolveAutotune.jl token-free sharing
581
+ - Timestamp: $(Dates. now ())
582
+ - System: $cpu_name on $os_name
583
+
584
+ Please feel free to include this data in the community benchmark database.
585
+
586
+ Best regards,
587
+ A LinearSolve.jl User
588
+
589
+ ---
590
+ Generated automatically by LinearSolve.jl autotune system
591
+ """
592
+ return template
593
+ end
594
+
595
+ """
596
+ create_discord_format(content, system_info)
597
+
598
+ Create a Discord/Slack-friendly format for community sharing.
599
+ """
600
+ function create_discord_format (content, system_info)
601
+ cpu_name = get (system_info, " cpu_name" , " Unknown CPU" )
602
+
603
+ # Extract key performance numbers from content
604
+ lines = split (content, " \n " )
605
+ summary_lines = String[]
606
+
607
+ for line in lines
608
+ if contains (line, " GFLOPs" ) || contains (line, " Best algorithm" ) || contains (line, " CPU:" ) || contains (line, " OS:" )
609
+ push! (summary_lines, line)
610
+ end
611
+ end
612
+
613
+ discord_content = """
614
+ 🚀 **LinearSolve.jl Benchmark Results** 🚀
615
+
616
+ **System**: $cpu_name
617
+ **Timestamp**: $(Dates. format (Dates. now (), " yyyy-mm-dd HH:MM" ))
618
+
619
+ **Key Results**:
620
+ $(join (summary_lines, " \n " ))
621
+
622
+ ```
623
+ $content
624
+ ```
625
+
626
+ *Generated by LinearSolveAutotune.jl - helping optimize LinearSolve for everyone! 🤖*
627
+
628
+ #LinearSolve #Julia #Benchmarks
629
+ """
630
+ return discord_content
631
+ end
632
+
633
+ """
634
+ create_http_post_command(content, system_info)
635
+
636
+ Create an HTTP POST command for future submission endpoints.
637
+ """
638
+ function create_http_post_command (content, system_info)
639
+ # Create a simple curl command for future HTTP submission endpoint
640
+ timestamp = replace (string (Dates. now ()), " :" => " -" )
641
+
642
+ command = """ #!/bin/bash
643
+ # LinearSolve.jl Benchmark Submission Script
644
+ # Generated on $(Dates. now ())
645
+
646
+ echo "Submitting LinearSolve.jl benchmark results..."
647
+
648
+ # Note: Update the endpoint URL when available
649
+ ENDPOINT="https://api.sciml.ai/linearsolve/benchmarks" # Placeholder endpoint
650
+
651
+ # Create temporary JSON file
652
+ cat > benchmark_data.json << 'EOF'
653
+ {
654
+ "timestamp": "$(Dates. now ()) ",
655
+ "system_info": $(JSON. json (system_info)) ,
656
+ "benchmark_results": $(JSON. json (content))
657
+ }
658
+ EOF
659
+
660
+ # Submit via HTTP POST (uncomment when endpoint is ready)
661
+ # curl -X POST "\$ ENDPOINT" \\
662
+ # -H "Content-Type: application/json" \\
663
+ # -d @benchmark_data.json
664
+
665
+ echo "✅ Benchmark data prepared for submission"
666
+ echo "📁 Data saved to benchmark_data.json"
667
+ echo "🌐 Submit when HTTP endpoint becomes available"
668
+
669
+ # Clean up
670
+ # rm benchmark_data.json
671
+ """
672
+ return command
673
+ end
674
+
431
675
"""
432
676
create_benchmark_issue(target_repo, fallback_repo, content, auth, system_info)
433
677
0 commit comments