Australian shares have limped across the finish line but notched a second straight week of gains, despite facing a slew of domestic and global risks.