If you completed your roommate's assignment, the expectation would be that that would be fundamentally improper. There may be certain limited circumstances where that may not be the case, but almost all colleges and universities will regard that as a breach of the academic process or a breach of academic integrity. It depends in terms of how to best resolve the situation as to what to do about it. The school will, say, be following up to invite a meeting about the matter. If you're trying to get an outcome that would be respectable to the circumstances, you need to take the necessary precautions before engaging with the school in terms of, say, seeking a mitigated outcome, maybe, say, the most realistic resolution to such a matter where the potential punishment is as least severe as possible. There may be certain circumstances where a person can avoid a finding of responsibility by challenging the allegation. It does depend on the specific facts and circumstances at hand.
It is a serious allegation, and having an experienced attorney advisor will be your best ally to help you understand and navigate the process and to take the best steps forward.