If you want a cheap power supply that will do that, get a Korad KD3005P.
If you want to design it, first you need to decide on specs like:
Voltage, current, power (that's done)
Output ripple voltage in voltage mode, and current ripple in current limit mode
This is important if you use a switching converter, you'll want to know how much switching noise remains in the output.
Accuracy of voltage setting, also readback if it supports it, and same for current if it supports it.
What kind of load impedance it should be stable with (capacitance, ESR, etc)
If it is like a bench power supply with settable current limit, speed of switching from voltage to current mode and back.
This one is tricky. If you set the voltage to 30V and the current to 20mA, then connect a 5mm LED on the output, the output capacitors will be charged to 30V. If the capacitors are large, the LED will blow before the current limit circuit even notices. So the capacitors have to be tiny. But the current limit circuit also has to be fast enough.
microcontroller --> potentiometer --> Switching voltage regulator
It would be cheaper and more efficient to control the output voltage of a mains-powered switching supply. But this then becomes a SMPS design problem.
If you use a constant voltage SMPS and a switching converter, then you nee a switcher that will support the whole voltage range. Make sure to check the maximum ON-time of the FETs, because it's never 100% for a design that uses NMOS, so if you want 30V on the output you'll need a few extra volts on the input.
If you replace the feedback divider with a digital potentiometer, loop gain will change depending on potentiometer setting. So you'll need to have an AC feedback path through a series RC that doesn't go through the pot, and a DC path that goes through the pot. Also output voltage won't go below the internal voltage reference. And, if the digipot is a 5V device, then it won't work with more than 5V signals, which could severely limit your output voltage range.
Another option is to inject a DC offset into the feedback node, for example by connecting the "GND" end of the feedback divider to the output of a DAC. Say the switcher has an internal 1V2 reference, and you set the feedback divider so you get 30V on the output. If you shift the "GND" end of the feedback divider to +1.2V, then you get 0V output, so with a 3.3V or 5V DAC and a resistor divider, you can set your output voltage easily. It can also go below the internal reference voltage.
Note that there already are tons of cheap products that do this.