Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow install cargo package from git #219

Merged
merged 11 commits into from
Sep 23, 2024
8 changes: 7 additions & 1 deletion ci.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"estuary": "0.1.1",
"cross": "0.2.5",
"toml-cli2": "0.3.2"
},
"git": {
"estuary": {
"url": "https://github.com/fuzzypixelz/estuary.git",
diogomatsubara marked this conversation as resolved.
Show resolved Hide resolved
"branch": "main"
}
}
}
}
}
18 changes: 14 additions & 4 deletions dist/build-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127473,8 +127473,16 @@ function packagesDebian(path) {
* Installs a cargo binary by compiling it from source using `cargo install`.
* The executable is cached using GitHub's `@actions/cache`.
* @param name Name of the cargo binary on crates.io
* @param options Options to pass to cargo install command
*/
async function installBinaryCached(name) {
async function installBinaryCached(name, options) {
const command = ["cargo", "+stable", "install"];
if (options.gitUrl != undefined) {
command.push("--git", options.gitUrl);
}
if (options.gitBranch != undefined) {
command.push("--branch", options.gitBranch);
}
if (process.env["GITHUB_ACTIONS"] != undefined) {
const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")];
const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name];
Expand All @@ -127485,12 +127493,14 @@ async function installBinaryCached(name) {
// failure
const hit = await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.restoreCache(paths, key);
if (hit == undefined) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name} --force`);
command.push(name, "--force");
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.saveCache(paths, key);
}
}
else {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name}`);
command.push(name);
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
}
}
function build(path, target) {
Expand Down Expand Up @@ -127660,7 +127670,7 @@ __nccwpck_require__.d(__webpack_exports__, {
// UNUSED EXPORTS: gitEnv

;// CONCATENATED MODULE: ./ci.config.json
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"}}}');
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"},"git":{"estuary":{"url":"https://github.com/fuzzypixelz/estuary.git","branch":"main"}}}}');
;// CONCATENATED MODULE: ./src/config.ts

const config = ci_config_namespaceObject;
Expand Down
18 changes: 14 additions & 4 deletions dist/build-crates-standalone-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127457,8 +127457,16 @@ function packagesDebian(path) {
* Installs a cargo binary by compiling it from source using `cargo install`.
* The executable is cached using GitHub's `@actions/cache`.
* @param name Name of the cargo binary on crates.io
* @param options Options to pass to cargo install command
*/
async function installBinaryCached(name) {
async function installBinaryCached(name, options) {
const command = ["cargo", "+stable", "install"];
if (options.gitUrl != undefined) {
command.push("--git", options.gitUrl);
}
if (options.gitBranch != undefined) {
command.push("--branch", options.gitBranch);
}
if (process.env["GITHUB_ACTIONS"] != undefined) {
const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")];
const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name];
Expand All @@ -127469,12 +127477,14 @@ async function installBinaryCached(name) {
// failure
const hit = await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.restoreCache(paths, key);
if (hit == undefined) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name} --force`);
command.push(name, "--force");
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.saveCache(paths, key);
}
}
else {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name}`);
command.push(name);
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
}
}
function build(path, target) {
Expand Down Expand Up @@ -127644,7 +127654,7 @@ __nccwpck_require__.d(__webpack_exports__, {
// UNUSED EXPORTS: gitEnv

;// CONCATENATED MODULE: ./ci.config.json
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"}}}');
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"},"git":{"estuary":{"url":"https://github.com/fuzzypixelz/estuary.git","branch":"main"}}}}');
;// CONCATENATED MODULE: ./src/config.ts

const config = ci_config_namespaceObject;
Expand Down
18 changes: 14 additions & 4 deletions dist/bump-crates-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -81179,8 +81179,16 @@ function packagesDebian(path) {
* Installs a cargo binary by compiling it from source using `cargo install`.
* The executable is cached using GitHub's `@actions/cache`.
* @param name Name of the cargo binary on crates.io
* @param options Options to pass to cargo install command
*/
async function installBinaryCached(name) {
async function installBinaryCached(name, options) {
const command = ["cargo", "+stable", "install"];
if (options.gitUrl != undefined) {
command.push("--git", options.gitUrl);
}
if (options.gitBranch != undefined) {
command.push("--branch", options.gitBranch);
}
if (process.env["GITHUB_ACTIONS"] != undefined) {
const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")];
const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name];
Expand All @@ -81191,12 +81199,14 @@ async function installBinaryCached(name) {
// failure
const hit = await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.restoreCache(paths, key);
if (hit == undefined) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name} --force`);
command.push(name, "--force");
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.saveCache(paths, key);
}
}
else {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name}`);
command.push(name);
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
}
}
function build(path, target) {
Expand Down Expand Up @@ -81365,7 +81375,7 @@ __nccwpck_require__.d(__webpack_exports__, {
});

;// CONCATENATED MODULE: ./ci.config.json
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"}}}');
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"},"git":{"estuary":{"url":"https://github.com/fuzzypixelz/estuary.git","branch":"main"}}}}');
;// CONCATENATED MODULE: ./src/config.ts

const config = ci_config_namespaceObject;
Expand Down
25 changes: 20 additions & 5 deletions dist/publish-crates-cargo-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -81067,8 +81067,16 @@ function packagesDebian(path) {
* Installs a cargo binary by compiling it from source using `cargo install`.
* The executable is cached using GitHub's `@actions/cache`.
* @param name Name of the cargo binary on crates.io
* @param options Options to pass to cargo install command
*/
async function installBinaryCached(name) {
async function installBinaryCached(name, options) {
const command = ["cargo", "+stable", "install"];
if (options.gitUrl != undefined) {
command.push("--git", options.gitUrl);
}
if (options.gitBranch != undefined) {
command.push("--branch", options.gitBranch);
}
if (process.env["GITHUB_ACTIONS"] != undefined) {
const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")];
const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name];
Expand All @@ -81079,12 +81087,14 @@ async function installBinaryCached(name) {
// failure
const hit = await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.restoreCache(paths, key);
if (hit == undefined) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name} --force`);
command.push(name, "--force");
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.saveCache(paths, key);
}
}
else {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name}`);
command.push(name);
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
}
}
function build(path, target) {
Expand Down Expand Up @@ -81254,7 +81264,7 @@ __nccwpck_require__.d(__webpack_exports__, {
// UNUSED EXPORTS: gitEnv

;// CONCATENATED MODULE: ./ci.config.json
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"}}}');
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"},"git":{"estuary":{"url":"https://github.com/fuzzypixelz/estuary.git","branch":"main"}}}}');
;// CONCATENATED MODULE: ./src/config.ts

const config = ci_config_namespaceObject;
Expand Down Expand Up @@ -81287,6 +81297,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(2186);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nccwpck_require__.n(_actions_core__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _cargo__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(8683);
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(98);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_cargo__WEBPACK_IMPORTED_MODULE_5__]);
_cargo__WEBPACK_IMPORTED_MODULE_5__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];

Expand All @@ -81295,6 +81306,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_5__ = (__webpack_async_dependencies__.then ? (aw




const name = "estuary";
const baseUrl = "http://localhost:7878";
const index = `${baseUrl}/git/index`;
Expand All @@ -81312,7 +81324,10 @@ async function spawn() {
},
stdio: "inherit",
};
await _cargo__WEBPACK_IMPORTED_MODULE_5__/* .installBinaryCached */ .Mj(name);
await _cargo__WEBPACK_IMPORTED_MODULE_5__/* .installBinaryCached */ .Mj(name, {
gitUrl: _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.git.estuary.url */ .v.lock.git.estuary.url,
gitBranch: _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.git.estuary.branch */ .v.lock.git.estuary.branch,
});
const proc = child_process__WEBPACK_IMPORTED_MODULE_0__.spawn("estuary", ["--base-url", baseUrl, "--crate-dir", crateDir, "--index-dir", indexDir], options);
_actions_core__WEBPACK_IMPORTED_MODULE_4__.info(`Spawned estuary (${proc.pid}) with base URL ${baseUrl} and data directory ${tmp}`);
return { name, index, token, crateDir, indexDir, proc };
Expand Down
18 changes: 14 additions & 4 deletions dist/publish-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127452,8 +127452,16 @@ function packagesDebian(path) {
* Installs a cargo binary by compiling it from source using `cargo install`.
* The executable is cached using GitHub's `@actions/cache`.
* @param name Name of the cargo binary on crates.io
* @param options Options to pass to cargo install command
*/
async function installBinaryCached(name) {
async function installBinaryCached(name, options) {
const command = ["cargo", "+stable", "install"];
if (options.gitUrl != undefined) {
command.push("--git", options.gitUrl);
}
if (options.gitBranch != undefined) {
command.push("--branch", options.gitBranch);
}
if (process.env["GITHUB_ACTIONS"] != undefined) {
const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")];
const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name];
Expand All @@ -127464,12 +127472,14 @@ async function installBinaryCached(name) {
// failure
const hit = await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.restoreCache(paths, key);
if (hit == undefined) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name} --force`);
command.push(name, "--force");
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.saveCache(paths, key);
}
}
else {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name}`);
command.push(name);
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
}
}
function build(path, target) {
Expand Down Expand Up @@ -127639,7 +127649,7 @@ __nccwpck_require__.d(__webpack_exports__, {
// UNUSED EXPORTS: gitEnv

;// CONCATENATED MODULE: ./ci.config.json
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"}}}');
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"},"git":{"estuary":{"url":"https://github.com/fuzzypixelz/estuary.git","branch":"main"}}}}');
;// CONCATENATED MODULE: ./src/config.ts

const config = ci_config_namespaceObject;
Expand Down
18 changes: 14 additions & 4 deletions dist/publish-crates-eclipse-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127533,8 +127533,16 @@ function packagesDebian(path) {
* Installs a cargo binary by compiling it from source using `cargo install`.
* The executable is cached using GitHub's `@actions/cache`.
* @param name Name of the cargo binary on crates.io
* @param options Options to pass to cargo install command
*/
async function installBinaryCached(name) {
async function installBinaryCached(name, options) {
const command = ["cargo", "+stable", "install"];
if (options.gitUrl != undefined) {
command.push("--git", options.gitUrl);
}
if (options.gitBranch != undefined) {
command.push("--branch", options.gitBranch);
}
if (process.env["GITHUB_ACTIONS"] != undefined) {
const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")];
const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name];
Expand All @@ -127545,12 +127553,14 @@ async function installBinaryCached(name) {
// failure
const hit = await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.restoreCache(paths, key);
if (hit == undefined) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name} --force`);
command.push(name, "--force");
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.saveCache(paths, key);
}
}
else {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name}`);
command.push(name);
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
}
}
function build(path, target) {
Expand Down Expand Up @@ -127741,7 +127751,7 @@ __nccwpck_require__.d(__webpack_exports__, {
// UNUSED EXPORTS: gitEnv

;// CONCATENATED MODULE: ./ci.config.json
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"}}}');
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"},"git":{"estuary":{"url":"https://github.com/fuzzypixelz/estuary.git","branch":"main"}}}}');
;// CONCATENATED MODULE: ./src/config.ts

const config = ci_config_namespaceObject;
Expand Down
18 changes: 14 additions & 4 deletions dist/publish-crates-github-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127533,8 +127533,16 @@ function packagesDebian(path) {
* Installs a cargo binary by compiling it from source using `cargo install`.
* The executable is cached using GitHub's `@actions/cache`.
* @param name Name of the cargo binary on crates.io
* @param options Options to pass to cargo install command
*/
async function installBinaryCached(name) {
async function installBinaryCached(name, options) {
const command = ["cargo", "+stable", "install"];
if (options.gitUrl != undefined) {
command.push("--git", options.gitUrl);
}
if (options.gitBranch != undefined) {
command.push("--branch", options.gitBranch);
}
if (process.env["GITHUB_ACTIONS"] != undefined) {
const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")];
const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name];
Expand All @@ -127545,12 +127553,14 @@ async function installBinaryCached(name) {
// failure
const hit = await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.restoreCache(paths, key);
if (hit == undefined) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name} --force`);
command.push(name, "--force");
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
await _actions_cache__WEBPACK_IMPORTED_MODULE_3__.saveCache(paths, key);
}
}
else {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo +stable install ${name}`);
command.push(name);
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(command.join(" "));
}
}
function build(path, target) {
Expand Down Expand Up @@ -127720,7 +127730,7 @@ __nccwpck_require__.d(__webpack_exports__, {
// UNUSED EXPORTS: gitEnv

;// CONCATENATED MODULE: ./ci.config.json
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"}}}');
const ci_config_namespaceObject = JSON.parse('{"git":{"user":{"name":"eclipse-zenoh-bot","email":"[email protected]"}},"lock":{"cratesio":{"cargo-deb":"2.1.0","estuary":"0.1.1","cross":"0.2.5","toml-cli2":"0.3.2"},"git":{"estuary":{"url":"https://github.com/fuzzypixelz/estuary.git","branch":"main"}}}}');
;// CONCATENATED MODULE: ./src/config.ts

const config = ci_config_namespaceObject;
Expand Down
Loading