Catrin, couple suggestions to see if it helps.
drink some electrolytes before bed,
eat a banana everyday for the magnesium.
use your foam roller or a rolling stick if you have one.
massage your calves by getting on your hands and knees and then taking the knee from the opposite leg and pressing it into your calf muscle and rotating the knee as you move up and down your calf (yes, I know you are feeling the shin but this will help over all)
take a tennis ball and roll your shin area
Do hip flexor stretches (expect you are)

I hate shin cramps and find I get them most often when we've been riding in hot weather and I haven't had enough fluids.