Britain announced today a comprehensive package of actions intended to punish the Soviet Union for its invasion of Afghanistan, including cancellation of high-level ministerial, military and cultural contact with Moscow.

Foreign Secretary Lord Carrington, in a speech to Parliament, said the plan included ending a preferential commercial credit agreement and cooperating with the United States and others to restrict strategic high-technology exports to the Soviet Union.

The British expect most of these steps to be matched by many other European allies.

While Carrington's Announcement represented the strongest and most detailed response by the British to Moscow's intervention, it did not exceed the minimal response agreed to by U.S. allies recently.

Carrington said Britain will continue to press the other eight members of the European Economic Commuity to stop the subsidized sale of surplus Common Market butter, poultry and sugar to the Soviets. The Common Market countries already have agreed to support the U.S. embargo on grain sales to the Soviet Union by ending their small sales to Moscow and holding their grain exports to Eastern European countries at present levels.

The British Broadcasting Corporation's foreign-language programs beamed to the Soviet Union and Afghanistan are also going to be increased and Britain will continue Prime Minister Margaret Thatcher's campaign to move next summer's Olympic Games out of Moscow.

Finally, Carrington said Britain is considering, with the United States and other allies, giving economic and possibly military assistance to countries around Afghanistan. The aid would help protect them from Soviet attack or subversion, he said, and protect "the stability and integrity of the [Persian] Gulf and the Straits of Hormuz," through which much of the oil produced in the Middle East is shipped. Neither Carrington nor other British officials disclosed details of their consultations about this with the United States and other allies.

But the British are not reducing their present trade with the Soviet Union or any future trade that can be secured with nonpreferential credit arrangements. A small decrease in exports of computer technology is possible, according to British officials, only if the other allies go along with a U.S. request to restrict exports of technology that could be put to military use by the Soviets.

Otherwise, the British are not joining the United States in curbing exports to the Soviets of technology dealing with computers, chemicals, construction or oil drilling. The British will continue to compete with France, for example, for $300 million contract to build deep-sea oil-drilling platforms for the Soviets in the Caspian Sea.

The British found no advantage, explained on official, in banning trade with the Soviets that other European allies, notably France, would substitute. The official said the government did not want to weaken the competitive position of British businesses that have struggled to win a relatively modest amount of advance technology trade with the Soviets, who in turn sell the British diamonds, timber, furs and other raw materials.

Except for its efforts to embargo Common Market exports of subsidized food to the Soviets, Britain's retaliatory actions against the Soviet Union thus do not exceed the minimal response agreed to by allies in the North Atlantic Treaty Organization in their negotiations during the past several weeks with U.S. Deputy Secretary of State Warren Christopher.

The British are cancelling exchange of Air Force Staff College students and naval ship visits with the Soviets as well as visits to Britain of varaious Soviet officials, a group of Soviet film directors and the Red Army choir. But Britain will allow a Georgian drama group to perform at a London theater and the English Chamber Orchestra to go ahead with a visit to the Soviet Union because, according to an official, these were not considered to be "high-level" contacts.

Today's announcement is expected to set the pattern for most of the European allies, none of whom are likely to go further than the British in response to the U.S. request for tough allied action against the Soviets. British officials expect similar announcements soon from several of the other allies.

One further step the British took today was to reveal an ongoing but previously secret $2 billion defense project to improve the ability of British nuclear missiles to penetrate the Soviets' upgraded missile defense.

By the end of next year, Defense Secretary Francis Pym announced in Parliament, the complicated new missile guidance system code-named "Chevaline" and developed with the assistance of the United States will be ready for deployment of the Polaris submarines missiles that constitute Britain's independent nuclelar deterrent. NATO nuclear missiles under the control of the U.S. military also are deployed at land and sea bases here.

Pym also hinted more broadly than before that Britain intends to spend possibly $10 billion or more during the next 10 to 15 years to eventually modernize its nuclear deterrent with five new U.S. made Polaris submarines armed with British nuclear warheads.

He said Thatcher and Carter discussed during Thatcher's visit in Washington last month and agreed that the United States would "support the maintenance of our strategic deterrent capability and Anglo-American cooperation in providing it." Expert British-American consultations begun during the summer will continue, according to Pym.

British officials also expressed strong support today for the "Carter doctrine" principles pledging support of the Middle East and South Asia against further encroachment by the Soviet Union. In announcing the British retaliatory measures against the Soviets, Carrington, who had recently toured the region promised British participation in allied efforts to assist countries there.