@@ -7059,68 +7059,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
70597059 step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
70607060 } ) ;
70617061} ;
7062- var __importDefault = ( this && this . __importDefault ) || function ( mod ) {
7063- return ( mod && mod . __esModule ) ? mod : { "default" : mod } ;
7064- } ;
70657062Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
70667063exports . runLinux = runLinux ;
70677064const core = __importStar ( __nccwpck_require__ ( 186 ) ) ;
70687065const io = __importStar ( __nccwpck_require__ ( 436 ) ) ;
70697066const apt = __importStar ( __nccwpck_require__ ( 671 ) ) ;
70707067const pip = __importStar ( __nccwpck_require__ ( 744 ) ) ;
70717068const utils = __importStar ( __nccwpck_require__ ( 314 ) ) ;
7072- const path = __importStar ( __nccwpck_require__ ( 17 ) ) ;
7073- const fs_1 = __importDefault ( __nccwpck_require__ ( 147 ) ) ;
7074- // Open Robotics APT Repository public GPG key, as retrieved at:
7075- // https://github.com/ros/rosdistro/blob/master/ros.asc
7076- //
7077- // Unfortunately, usin apt-key adv is slow, and is failing sometimes, causing
7078- // spurious pipelines failures. The action is hard-coding the key here to
7079- // mitigate this issue.
7080- const openRoboticsAptPublicGpgKey = `
7081- -----BEGIN PGP PUBLIC KEY BLOCK-----
7082- Version: GnuPG v1
7083-
7084- mQINBFzvJpYBEADY8l1YvO7iYW5gUESyzsTGnMvVUmlV3XarBaJz9bGRmgPXh7jc
7085- VFrQhE0L/HV7LOfoLI9H2GWYyHBqN5ERBlcA8XxG3ZvX7t9nAZPQT2Xxe3GT3tro
7086- u5oCR+SyHN9xPnUwDuqUSvJ2eqMYb9B/Hph3OmtjG30jSNq9kOF5bBTk1hOTGPH4
7087- K/AY0jzT6OpHfXU6ytlFsI47ZKsnTUhipGsKucQ1CXlyirndZ3V3k70YaooZ55rG
7088- aIoAWlx2H0J7sAHmqS29N9jV9mo135d+d+TdLBXI0PXtiHzE9IPaX+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5D16Z7aOoazG9DKbewA+da8Drw=
7121- =9IZg
7122- -----END PGP PUBLIC KEY BLOCK-----
7123- ` ;
71247069/**
71257070 * Configure basic OS stuff.
71267071 */
@@ -7160,43 +7105,37 @@ function configOs() {
71607105 yield apt . runAptGetInstall ( [ "tzdata" ] ) ;
71617106 } ) ;
71627107}
7163- /**
7164- * Add OSRF APT repository key.
7165- *
7166- * This is necessary even when building from source to install colcon, vcs, etc.
7167- */
7168- function addAptRepoKey ( ) {
7169- return __awaiter ( this , void 0 , void 0 , function * ( ) {
7170- const workspace = process . env . GITHUB_WORKSPACE ;
7171- const keyFilePath = path . join ( workspace , "ros.key" ) ;
7172- fs_1 . default . writeFileSync ( keyFilePath , openRoboticsAptPublicGpgKey ) ;
7173- yield utils . exec ( "sudo" , [ "apt-key" , "add" , keyFilePath ] ) ;
7174- } ) ;
7175- }
71767108// Ubuntu distribution for ROS 1
71777109const ros1UbuntuVersion = "focal" ;
71787110/**
71797111 * Add OSRF APT repository.
71807112 *
71817113 * @param ubuntuCodename the Ubuntu version codename
7114+ * @param use_ros2_testing whether to use the apt testing repository
71827115 */
71837116function addAptRepo ( ubuntuCodename , use_ros2_testing ) {
71847117 return __awaiter ( this , void 0 , void 0 , function * ( ) {
7118+ // Install key and apt repo using ros-apt-source:
7119+ // https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debs.html#enable-required-repositories
7120+ const GITHUB_REPO = "ros-infrastructure/ros-apt-source" ;
7121+ const apt_source_latest = yield utils . getCommandOutput ( `curl -s https://api.github.com/repos/${ GITHUB_REPO } /releases/latest | grep -F "tag_name" | awk -F\\" '{print $4}'` ) ;
7122+ const deb_file = "/tmp/apt-source.deb" ;
7123+ let deb_url = "" ;
71857124 // There is now no Ubuntu version overlap between ROS 1 and ROS 2
71867125 if ( ros1UbuntuVersion === ubuntuCodename ) {
7187- yield utils . exec ( "sudo" , [
7188- "bash" ,
7189- "-c" ,
7190- `echo "deb http://packages.ros.org/ros/ubuntu ${ ubuntuCodename } main" > /etc/apt/sources.list.d/ros-latest.list` ,
7191- ] ) ;
7126+ deb_url = `https://github.com/${ GITHUB_REPO } /releases/download/${ apt_source_latest } /ros-apt-source_${ apt_source_latest } .${ ubuntuCodename } _all.deb` ;
71927127 }
71937128 else {
7194- yield utils . exec ( "sudo" , [
7195- "bash" ,
7196- "-c" ,
7197- `echo "deb http://packages.ros.org/ros2${ use_ros2_testing ? "-testing" : "" } /ubuntu ${ ubuntuCodename } main" > /etc/apt/sources.list.d/ros2-latest.list` ,
7198- ] ) ;
7129+ const testing = use_ros2_testing ? "-testing" : "" ;
7130+ deb_url = `https://github.com/${ GITHUB_REPO } /releases/download/${ apt_source_latest } /ros2${ testing } -apt-source_${ apt_source_latest } .${ ubuntuCodename } _all.deb` ;
71997131 }
7132+ yield utils . exec ( "sudo" , [
7133+ "bash" ,
7134+ "-c" ,
7135+ `curl -L -o ${ deb_file } "${ deb_url } "` ,
7136+ ] ) ;
7137+ yield utils . exec ( "sudo" , [ "bash" , "-c" , `apt install ${ deb_file } ` ] ) ;
7138+ yield utils . exec ( "sudo" , [ "bash" , "-c" , `rm ${ deb_file } ` ] ) ;
72007139 yield utils . exec ( "sudo" , [ "apt-get" , "update" ] ) ;
72017140 } ) ;
72027141}
@@ -7226,7 +7165,6 @@ function runLinux() {
72267165 const use_ros2_testing = core . getInput ( "use-ros2-testing" ) === "true" ;
72277166 const installConnext = core . getInput ( "install-connext" ) === "true" ;
72287167 yield configOs ( ) ;
7229- yield addAptRepoKey ( ) ;
72307168 const ubuntuCodename = yield utils . determineDistribCodename ( ) ;
72317169 yield addAptRepo ( ubuntuCodename , use_ros2_testing ) ;
72327170 if ( "noble" !== ubuntuCodename ) {
@@ -7533,6 +7471,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
75337471exports . exec = exec ;
75347472exports . getRequiredRosDistributions = getRequiredRosDistributions ;
75357473exports . validateDistro = validateDistro ;
7474+ exports . getCommandOutput = getCommandOutput ;
75367475exports . determineDistribCodename = determineDistribCodename ;
75377476exports . determineDistrib = determineDistrib ;
75387477exports . determineDistribVer = determineDistribVer ;
0 commit comments