diff --git a/.github/workflows/release-crates-cargo.yml b/.github/workflows/release-crates-cargo.yml index 8c3cb9a..d83b15a 100644 --- a/.github/workflows/release-crates-cargo.yml +++ b/.github/workflows/release-crates-cargo.yml @@ -18,6 +18,10 @@ on: unpublished-deps-repos: type: string required: false + installation-test: + type: boolean + required: true + default: true workflow_dispatch: inputs: repo: @@ -35,6 +39,10 @@ on: unpublished-deps-repos: type: string required: false + installation-test: + type: boolean + required: true + default: true jobs: publish: @@ -49,3 +57,4 @@ jobs: unpublished-deps-repos: ${{ inputs.unpublished-deps-repos }} github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} crates-io-token: ${{ secrets.CRATES_IO_TOKEN }} + installation-test: ${{ inputs.installation-test }} diff --git a/dist/publish-crates-cargo-main.js b/dist/publish-crates-cargo-main.js index 65e1c57..3b85401 100644 --- a/dist/publish-crates-cargo-main.js +++ b/dist/publish-crates-cargo-main.js @@ -81358,6 +81358,7 @@ function setup() { const cratesIoToken = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("crates-io-token", { required: true }); const unpublishedDepsPatterns = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("unpublished-deps-patterns"); const unpublishedDepsRepos = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("unpublished-deps-repos"); + const installationTest = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getBooleanInput("installation-test", { required: true }); return { liveRun, branch, @@ -81366,17 +81367,20 @@ function setup() { unpublishedDepsRegExp: unpublishedDepsPatterns === "" ? /^$/ : new RegExp(unpublishedDepsPatterns.split("\n").join("|")), unpublishedDepsRepos: unpublishedDepsRepos === "" ? [] : unpublishedDepsRepos.split("\n"), cratesIoToken, + installationTest, }; } async function main(input) { let registry = undefined; try { registry = await _estuary__WEBPACK_IMPORTED_MODULE_2__/* .spawn */ .C(); - for (const repo of input.unpublishedDepsRepos) { - await publishToEstuary(input, repo, registry, input.unpublishedDepsRegExp); + if (input.installationTest) { + for (const repo of input.unpublishedDepsRepos) { + await publishToEstuary(input, repo, registry, input.unpublishedDepsRegExp); + } + await publishToEstuary(input, input.repo, registry, input.unpublishedDepsRegExp, input.branch); + await deleteRepos(input); } - await publishToEstuary(input, input.repo, registry, input.unpublishedDepsRegExp, input.branch); - await deleteRepos(input); if (input.liveRun) { for (const repo of input.unpublishedDepsRepos) { publishToCratesIo(input, repo); diff --git a/publish-crates-cargo/action.yml b/publish-crates-cargo/action.yml index 6582ad9..bd62f5b 100644 --- a/publish-crates-cargo/action.yml +++ b/publish-crates-cargo/action.yml @@ -15,6 +15,8 @@ inputs: required: false unpublished-deps-repos: required: false + installation-test: + required: true runs: using: node20 diff --git a/src/publish-crates-cargo.ts b/src/publish-crates-cargo.ts index 0738ddd..1ba5987 100644 --- a/src/publish-crates-cargo.ts +++ b/src/publish-crates-cargo.ts @@ -14,6 +14,7 @@ export type Input = { unpublishedDepsRegExp: RegExp; unpublishedDepsRepos: string[]; cratesIoToken?: string; + installationTest: boolean; }; export function setup(): Input { @@ -24,6 +25,7 @@ export function setup(): Input { const cratesIoToken = core.getInput("crates-io-token", { required: true }); const unpublishedDepsPatterns = core.getInput("unpublished-deps-patterns"); const unpublishedDepsRepos = core.getInput("unpublished-deps-repos"); + const installationTest = core.getBooleanInput("installation-test", { required: true }); return { liveRun, @@ -34,6 +36,7 @@ export function setup(): Input { unpublishedDepsPatterns === "" ? /^$/ : new RegExp(unpublishedDepsPatterns.split("\n").join("|")), unpublishedDepsRepos: unpublishedDepsRepos === "" ? [] : unpublishedDepsRepos.split("\n"), cratesIoToken, + installationTest, }; } @@ -42,13 +45,15 @@ export async function main(input: Input) { try { registry = await estuary.spawn(); - for (const repo of input.unpublishedDepsRepos) { - await publishToEstuary(input, repo, registry, input.unpublishedDepsRegExp); - } + if (input.installationTest) { + for (const repo of input.unpublishedDepsRepos) { + await publishToEstuary(input, repo, registry, input.unpublishedDepsRegExp); + } - await publishToEstuary(input, input.repo, registry, input.unpublishedDepsRegExp, input.branch); + await publishToEstuary(input, input.repo, registry, input.unpublishedDepsRegExp, input.branch); - await deleteRepos(input); + await deleteRepos(input); + } if (input.liveRun) { for (const repo of input.unpublishedDepsRepos) {