Does the bonus action from spiritual weapon break invisibility?


Suppose a character casts Spiritual Weapon one round, then casts invisibility the following round. Does using the bonus action from spiritual weapon to attack count as making an attack for the sake of ending the invisibility spell?