I think a related but separate question would be "Can I do these things if the proceeds are going directly to charity instead of to me?"
I suspect it would be important that any funds never reached you, so you couldn't simply receive money then donate that amount. Playing a charity gig where the receipts go directly to the charity would likely be fine, streaming/Spotify revenue I don't know, acting in a movie might be out of the question if it's being professionally shot because the producer might have insurance or other requirements that only paid performers and crew can be on set, etc.
IIRC from the time I was waiting for employment authorization, I wasn't allowed to do any charity work that could otherwise be a paid position, so be very careful with this charity idea.
I suspect it would be important that any funds never reached you, so you couldn't simply receive money then donate that amount. Playing a charity gig where the receipts go directly to the charity would likely be fine, streaming/Spotify revenue I don't know, acting in a movie might be out of the question if it's being professionally shot because the producer might have insurance or other requirements that only paid performers and crew can be on set, etc.