The Rhode Island Foundation had a record year of giving last year. The state’s largest funder of nonprofits said Tuesday that it awarded more than $30 million in grants in 2012, a nearly 9 percent increase over the prior year. The foundation also raised more than $38 million in new gifts from individual and corporate donors, making 2012 its third best fund-raising year. Its assets were a record $670 million at year’s end. The Fund for a Healthy Rhode Island got $1.8 million for work on building a stronger primary care system, and $739,575 went to groups including the Rhode Island Community Food Bank and Crossroads Rhode Island that provide emergency basic services assistance.