@@ -6965,13 +6965,23 @@ function addDnfRepo(use_ros2_testing) {
69656965 "--set-enabled" ,
69666966 extra_repo_name ,
69676967 ] ) ;
6968- const testing_repo_suffix = use_ros2_testing ? "-testing" : "" ;
6968+ // Install key and repo using ros-apt-source:
6969+ // https://docs.ros.org/en/rolling/Installation/RHEL-Install-RPMs.html#enable-required-repositories
6970+ const apt_version = yield utils . getRosAptSourceLatestVersion ( ) ;
69696971 yield utils . exec ( "sudo" , [
6970- "curl" ,
6971- "--output" ,
6972- "/etc/yum.repos.d/ros2.repo" ,
6973- `http://packages.ros.org/ros2${ testing_repo_suffix } /rhel/ros2${ testing_repo_suffix } .repo` ,
6972+ "dnf" ,
6973+ "install" ,
6974+ `https://github.com/${ utils . ROS_APT_SOURCE_REPO } /releases/download/${ apt_version } /ros2-release-${ apt_version } -1.noarch.rpm` ,
69746975 ] ) ;
6976+ if ( use_ros2_testing ) {
6977+ yield utils . exec ( "sudo" , [ "dnf" , "config-manager" , "--disable" , "ros2" ] ) ;
6978+ yield utils . exec ( "sudo" , [
6979+ "dnf" ,
6980+ "config-manager" ,
6981+ "--enable" ,
6982+ "ros2-testing" ,
6983+ ] ) ;
6984+ }
69756985 yield utils . exec ( "sudo" , [ "dnf" , "makecache" , "--assumeyes" ] ) ;
69766986 } ) ;
69776987}
@@ -7059,68 +7069,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
70597069 step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
70607070 } ) ;
70617071} ;
7062- var __importDefault = ( this && this . __importDefault ) || function ( mod ) {
7063- return ( mod && mod . __esModule ) ? mod : { "default" : mod } ;
7064- } ;
70657072Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
70667073exports . runLinux = runLinux ;
70677074const core = __importStar ( __nccwpck_require__ ( 186 ) ) ;
70687075const io = __importStar ( __nccwpck_require__ ( 436 ) ) ;
70697076const apt = __importStar ( __nccwpck_require__ ( 671 ) ) ;
70707077const pip = __importStar ( __nccwpck_require__ ( 744 ) ) ;
70717078const 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+ctdSUrPnp+
7089- TwR99lxglpIG6hLuvOMAaxiqFBB/Jf3XJ8OBakfS6nHrWH2WqQxRbiITl0irkQoz
7090- pwNEF2Bv0+Jvs1UFEdVGz5a8xexQHst/RmKrtHLct3iOCvBNqoAQRbvWvBhPjO/p
7091- V5cYeUljZ5wpHyFkaEViClaVWqa6PIsyLqmyjsruPCWlURLsQoQxABcL8bwxX7UT
7092- hM6CtH6tGlYZ85RIzRifIm2oudzV5l+8oRgFr9yVcwyOFT6JCioqkwldW52P1pk/
7093- /SnuexC6LYqqDuHUs5NnokzzpfS6QaWfTY5P5tz4KHJfsjDIktly3mKVfY0fSPVV
7094- okdGpcUzvz2hq1fqj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110- xlS/UA//aAgP67DunDdak96+fLemWJkl4PHhj6637lzacJ+SlRzeUbnS/2XLhmk1
7111- BNYoib3IHp3GBqvLsQqkCUZWaJTvkkAvJ+1W2N7JByt7Z/tnTS7aVfDxF53nYCxY
7112- eSH921y2AtIZCIl1N3R2ic7pyzNkVVqwKIV1EqWLMa8GQTy4V0pgwaLE6Ce9Bmtv
7113- 04upGyiPXRoPM3Rfc0mTUtPGJLf651img6TYGb1UbKs2aAitiI2ptg8EdiRYYcGo
7114- nG8Ar3aUnYj+fpfhTyvqwx0MTtAPDiMUx2vELReYIvhwU+SRHWpp20nL0WIK2krK
7115- qIq5SwIboBSLkQ5j7tjehKkqfxanUrlUxu/XYlEhq0Mh5oCfBrarIFBUBULUX86p
7116- ZQUqW4+MrIxHcNcrCPGm3U/4dSZ1rTAdyeEUi7a2H96CYYofl7dq1xXGMDFh+b5/
7117- 3Yw3t8US4VCwxmEj+C3ciARJauB1oDOilEieszPvIS3PdVpp6HCZRRHaB689AzMF
7118- FoD40iowsNS9XmO6O8V7xzVVS0EtNhz9qUGIz8yjWeLLdpR8NqHOFOvrPP66voEV
7119- Gc0Va/nozc05WWt42bc0hs1faRMqHRlAlJIKSUm4NSqc+YDNPYFlZSnB97tBhHC9
7120- CEXRgHY3Utq/I3CLJ+KcJCUCH5D16Z7aOoazG9DKbewA+da8Drw=
7121- =9IZg
7122- -----END PGP PUBLIC KEY BLOCK-----
7123- ` ;
71247079/**
71257080 * Configure basic OS stuff.
71267081 */
@@ -7160,43 +7115,36 @@ function configOs() {
71607115 yield apt . runAptGetInstall ( [ "tzdata" ] ) ;
71617116 } ) ;
71627117}
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- }
71767118// Ubuntu distribution for ROS 1
71777119const ros1UbuntuVersion = "focal" ;
71787120/**
71797121 * Add OSRF APT repository.
71807122 *
71817123 * @param ubuntuCodename the Ubuntu version codename
7124+ * @param use_ros2_testing whether to use the apt testing repository
71827125 */
71837126function addAptRepo ( ubuntuCodename , use_ros2_testing ) {
71847127 return __awaiter ( this , void 0 , void 0 , function * ( ) {
7128+ // Install key and apt repo using ros-apt-source:
7129+ // https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debs.html#enable-required-repositories
7130+ const apt_version = yield utils . getRosAptSourceLatestVersion ( ) ;
7131+ const deb_file = "/tmp/apt-source.deb" ;
7132+ let deb_url = "" ;
71857133 // There is now no Ubuntu version overlap between ROS 1 and ROS 2
71867134 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- ] ) ;
7135+ deb_url = `https://github.com/${ utils . ROS_APT_SOURCE_REPO } /releases/download/${ apt_version } /ros-apt-source_${ apt_version } .${ ubuntuCodename } _all.deb` ;
71927136 }
71937137 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- ] ) ;
7138+ const testing = use_ros2_testing ? "-testing" : "" ;
7139+ deb_url = `https://github.com/${ utils . ROS_APT_SOURCE_REPO } /releases/download/${ apt_version } /ros2${ testing } -apt-source_${ apt_version } .${ ubuntuCodename } _all.deb` ;
71997140 }
7141+ yield utils . exec ( "sudo" , [
7142+ "bash" ,
7143+ "-c" ,
7144+ `curl -L -o ${ deb_file } "${ deb_url } "` ,
7145+ ] ) ;
7146+ yield utils . exec ( "sudo" , [ "bash" , "-c" , `apt install ${ deb_file } ` ] ) ;
7147+ yield utils . exec ( "sudo" , [ "bash" , "-c" , `rm ${ deb_file } ` ] ) ;
72007148 yield utils . exec ( "sudo" , [ "apt-get" , "update" ] ) ;
72017149 } ) ;
72027150}
@@ -7226,7 +7174,6 @@ function runLinux() {
72267174 const use_ros2_testing = core . getInput ( "use-ros2-testing" ) === "true" ;
72277175 const installConnext = core . getInput ( "install-connext" ) === "true" ;
72287176 yield configOs ( ) ;
7229- yield addAptRepoKey ( ) ;
72307177 const ubuntuCodename = yield utils . determineDistribCodename ( ) ;
72317178 yield addAptRepo ( ubuntuCodename , use_ros2_testing ) ;
72327179 if ( "noble" !== ubuntuCodename ) {
@@ -7530,13 +7477,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
75307477 } ) ;
75317478} ;
75327479Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
7480+ exports . ROS_APT_SOURCE_REPO = void 0 ;
75337481exports . exec = exec ;
75347482exports . getRequiredRosDistributions = getRequiredRosDistributions ;
75357483exports . validateDistro = validateDistro ;
75367484exports . determineDistribCodename = determineDistribCodename ;
75377485exports . determineDistrib = determineDistrib ;
75387486exports . determineDistribVer = determineDistribVer ;
75397487exports . getArch = getArch ;
7488+ exports . getRosAptSourceLatestVersion = getRosAptSourceLatestVersion ;
75407489const actions_exec = __importStar ( __nccwpck_require__ ( 514 ) ) ;
75417490const core = __importStar ( __nccwpck_require__ ( 186 ) ) ;
75427491/**
@@ -7648,6 +7597,25 @@ function getArch() {
76487597 return getCommandOutput ( "dpkg --print-architecture" ) ;
76497598 } ) ;
76507599}
7600+ exports . ROS_APT_SOURCE_REPO = "ros-infrastructure/ros-apt-source" ;
7601+ /**
7602+ * Get the latest version of the ros-apt-source package.
7603+ *
7604+ * https://github.com/ros-infrastructure/ros-apt-source/releases
7605+ *
7606+ * @returns the latest version of the ros-apt-source packages
7607+ */
7608+ function getRosAptSourceLatestVersion ( ) {
7609+ return __awaiter ( this , void 0 , void 0 , function * ( ) {
7610+ // TODO(christophebedard): figure out why doesn't work and switch back
7611+ // return getCommandOutput(
7612+ // `curl -s https://api.github.com/repos/${ROS_APT_SOURCE_REPO}/releases/latest | grep -F "tag_name" | awk -F\\" '{print $4}'`,
7613+ // );
7614+ return new Promise ( ( resolve ) => {
7615+ resolve ( "1.1.0" ) ;
7616+ } ) ;
7617+ } ) ;
7618+ }
76517619
76527620
76537621/***/ } ) ,
0 commit comments