Riley, previously with Celtic, left Hamilton Accies this summer.
The 27-year-old O'Donnell, who has signed a year-long contract, had spent three seasons with St Mirren but was not part of the new manager's plans.
O'Donnell began his career with Dundee United and had a loan spell with Ross County before joining Boston United then Clyde.
He made 27 appearances last season and scored the equaliser in a 1-1 draw away to eventually-relegated Falkirk in May that effectively secured St Mirren's place in the Scottish Premier League.
However, after the departure of manager Gus MacPherson, he was not offered a new contract by new boss Danny Lennon on his arrival from Cowdenbeath.
Riley made his first-team debut for Celtic in 2006 but was sidelined for the whole of the following season through injury.
The winger, who can also play up front, thereafter failed to break into the Celtic starting line-up and signed a short-term deal with Hamilton after his release in January.
Source: BBC Sport
Source: BBC Sport