It depends on what works for you. If you thrive on being accountable, a public statement might work.
Science, however, leans more towards keeping your goals to yourself. Emotionally, the public commitment feels like having done enough to get to your goal already, which leads to less effort.
See here: https://www.ted.com/talks/derek_sivers_keep_your_goals_to_yourself