I think "the end of the year" commonly means "New Year's Eve". So I find it odd that pupils say good bye to one another on New Year's Eve. I might say like "Yesterday was the last day of the school year, and the pupils said good bye to one another."
The context would no doubt make it clear that the statement refers to the school year. So would the reference to 'yesterday' if you said this at the end of June, which is the normal end of most school years.