The "pure" answer to the question as asked is probably as others have said, climb as much as possible.
But perhaps a better answer is to admit that cycling is awesome for aerobic fitness and leg strength but not as great on the upper body.
Obviously, cross-training is an option, but even if you are 100% committed to your bike, you can probably get significant results from two common calisthenics pre and/or post ride: Push-ups and Pull-ups.
The key is that you want to develop your chest/shoulders/triceps (pushing) and your back/biceps (pulling), and doing multi-joint exercises is likely more efficient/helpful than isolation exercises.
If you can't do pull-ups and don't have access to a lat pulldown machine you can help yourself by using your legs to give yourself a gentle assist.
If you have or can scrounge some dumbbells you can do a bit more.
Try this: Do a set of 20-25 pushups, then 8-12 pull-ups, either just before or just after you put on your shorts/jersey.
Do a second set 5 minutes later
after you've made up your water bottles, etc., put on your shoes, whatever.
Pump up your tires and get your bike "ready," then do a third set.
Go for a ride, and try to get in as much climbing as possible.
You'll probably be amazed at how quickly your strength will improve just with three sets of good form concentrated upper body calisthenics pre-ride.
Again, if you have dumbbells or a weight bench you could do bench presses/military presses, or laterals, and you could do rows to help with the "pull," but the goal isn't really do to a full on weightlifting session, just some quick calisthenics with one effective push and one effective pull exercise and at least two, preferably three sets as you prep for your ride.
bicycles.stackexchange.com/users/3806/Dan Catlin
I think there are two important ways to use your upper body riding a bicycle:
Ride very steep hills, where you need to pull up the handlebar and swing your upper body to counteract the torque on the pedals (specially if you ride a bike without extra-low gears);
Riding over technical terrain, like XC mountain bike and other stuff.
While commuting, you can do these (or at least a bit of these) if you choose some unusual route if you live in a hilly area.
If that is not the case, I am afraid riding itself is not enough to provide significant upper-body exercise (except postural "exercise", which might indeed induce health issues if too prolongued).
Hope this helps
bicycles.stackexchange.com/users/2355/heltonbiker
There is a way to train your upper body while riding, but it's not the way most of people think of.
Have you ever looked at pro BMXers arms?
I rode BMX myself and can confirm that lots of bunnyhops, manuals and jumps are serious upper back, and whole arms workout.
Just think of it, in a bunnyhop you pull with your lower and upper back, together with the arms, then you push using again your back and arms.
But I don't know how this could go under common term of riding :-)
bicycles.stackexchange.com/users/5688/J-unior
From years of experience, I have found that riding with your upper body (arms/ chest / back) flexed, you will get a significantly better upper body work out than with your upper body relaxed, where you don't get any work out.
If your riding on rough terrain try to jump and wheelie your front tire over objects here and there; if your riding on the street, try to jump curbs and bunny hop on curbs here
and there, just be careful with traffic...try to find a trail/ route that you can master.
A quick upper body work out after your done riding helps as well.
bicycles.stackexchange.com/users/14228/Dan
Something mentioned before but without explaination:
The position you sit while riding can affect upper body strength.
When changing from a long ride on a cruiser to a long ride on a road bike, after the road bike trek I feel my arms working harder from holding more of my body weight up.
The geometry of your frame, seat height and handlebar position can greatly affect how much work your upper body does while cycling.
If I had a mountain bike, I wouldn't however try to adjust a mountain bike to road bike dropdowns specifically for this though!
bicycles.stackexchange.com/users/3804/Adam
Your bike is not a whole body gym.
You could do sprints standing in extreme gears, accelerating as fast as possible.
Sprinters tend to have developed upper bodies.
They don't develop them on the bike, but they use them enough.
bicycles.stackexchange.com/users/4154/Tim Zwart
Biking is not an upper body work out.
As a matter of fact: on longer treks I have found my arms getting rather numb.
Riding a stationary bicycle that works both arms and legs simultaneously is an upper body workout.
Riding a stationary bicycle that just pedals like your standard bicycle is not an upper body work out.
Sorry ... Unless you are not using your hands on the handle bars and swinging your arms wildly or flapping them, you are not exercising your upper body while riding a standard bicycle.
While exercising: make sure you do get enough liquids when riding and don't overdo it, because it can be a long way home.
bicycles.stackexchange.com/users/5795/amcuriousity
On a stationary bike you can press down in your thighs with both hands while you pedal to get a pretty good upper body workout.
On a moving bike you might be able to use one hand to steer and one hand to press on a thigh.
bicycles.stackexchange.com/users/17148/gregm
I often hear people say “your bike is a whole-body gym”. I know my upper body workout will never be close to the workout my legs get, but so long as I’m a bike commuter, I figure I ought to get as much as I can out of it. I have a Trek 8.3DS, flat handlebars, no bullhorns, no upright grips.  How do I adjust my riding style/choice of bike/choice of equipment/types of rides to maximize whatever upper body exercise biking can give me?
How do I maximize my upper body workout from riding?
bicycles.stackexchange.com
<training><fitness><hybrid-bike>
bicycles.stackexchange.com/questions/8812
bicycles.stackexchange.com/users/3538/Zac B
The truth is that cycling is a amazing for aerobic and leg fitness but it has little affect on the upper body. There are some exrcises that could be done while riding, such as pressing down hard on the handlebars and going off road where the terrain makes you use your upper body more. However, the best solution is to do upper bosy work in addition to cycling, maybe cross-training or some simple upper body exercises that can be done at home. While climbing, sprinting, mountain biking on technical terrain, BMX riding and changing your position when riding can exercise your upper body to some extent, cycling should generally not be considered a ful-body workout. A better option is to mix other exersises in with the cycling, such as calisthenics before and/or after cycling. Stationary bikes also allow more of a full-body workout, but the upper body needs to be active to see an effect.
While climbing, sprinting, mountain biking on technical terrain, BMX riding and changing your position when riding can exercise your upper body to some extent, cycling should generally not be considered a ful-body workout. A better option is to mix other exersises in with the cycling, such as calisthenics before and/or after cycling. Stationary bikes also allow more of a full-body workout, but the upper body needs to be active to see an effect.