Skip to content

Commit

Permalink
fix: Remove cleanup logic in build-crates-standalone (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz authored Apr 9, 2024
1 parent 516bcc1 commit d44239a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 56 deletions.
15 changes: 3 additions & 12 deletions dist/build-crates-standalone-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127161,16 +127161,16 @@ __nccwpck_require__.d(__webpack_exports__, {
"cY": () => (/* binding */ setup)
});

// UNUSED EXPORTS: artifactName, artifactRegExp, cleanup
// UNUSED EXPORTS: artifactName, artifactRegExp

// EXTERNAL MODULE: external "fs/promises"
var promises_ = __nccwpck_require__(73292);
// EXTERNAL MODULE: external "path"
var external_path_ = __nccwpck_require__(71017);
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
var lib_core = __nccwpck_require__(42186);
// EXTERNAL MODULE: ./node_modules/@actions/artifact/lib/artifact.js
var artifact = __nccwpck_require__(79450);
// EXTERNAL MODULE: external "fs/promises"
var promises_ = __nccwpck_require__(73292);
// EXTERNAL MODULE: external "os"
var external_os_ = __nccwpck_require__(22037);
// EXTERNAL MODULE: ./node_modules/@actions/cache/lib/cache.js
Expand Down Expand Up @@ -128475,7 +128475,6 @@ function describe(path = process.cwd()) {




const build_crates_standalone_artifact = new artifact.DefaultArtifactClient();
function setup() {
const repo = lib_core.getInput("repo", { required: true });
Expand Down Expand Up @@ -128515,10 +128514,8 @@ async function main(input) {
const { id } = await build_crates_standalone_artifact.uploadArtifact(output, [output], process.cwd());
lib_core.setOutput("artifact-id", id);
lib_core.setOutput("artifact-name", output);
await cleanup(input);
}
catch (error) {
await cleanup(input);
if (error instanceof Error)
lib_core.setFailed(error.message);
}
Expand All @@ -128527,12 +128524,6 @@ function artifactName(repo, version, target) {
return `${repo}-${version}-${target}-standalone.zip`;
}
const artifactRegExp = /^.*-standalone\.zip$/;
async function cleanup(input) {
const repoName = input.repo.split("/").at(1);
const repoPath = process.env["GITHUB_ACTIONS"] != undefined ? process.cwd() : repoName;
lib_core.info(`Deleting repository ${repoPath}`);
await promises_.rm(repoPath, { recursive: true, force: true });
}


/***/ }),
Expand Down
15 changes: 3 additions & 12 deletions dist/publish-crates-eclipse-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128495,7 +128495,6 @@ function describe(path = process.cwd()) {




const build_crates_standalone_artifact = new artifact.DefaultArtifactClient();
function setup() {
const repo = core.getInput("repo", { required: true });
Expand Down Expand Up @@ -128535,10 +128534,8 @@ async function main(input) {
const { id } = await build_crates_standalone_artifact.uploadArtifact(output, [output], process.cwd());
core.setOutput("artifact-id", id);
core.setOutput("artifact-name", output);
await cleanup(input);
}
catch (error) {
await cleanup(input);
if (error instanceof Error)
core.setFailed(error.message);
}
Expand All @@ -128547,12 +128544,6 @@ function artifactName(repo, version, target) {
return `${repo}-${version}-${target}-standalone.zip`;
}
const artifactRegExp = /^.*-standalone\.zip$/;
async function cleanup(input) {
const repoName = input.repo.split("/").at(1);
const repoPath = process.env["GITHUB_ACTIONS"] != undefined ? process.cwd() : repoName;
core.info(`Deleting repository ${repoPath}`);
await fs.rm(repoPath, { recursive: true, force: true });
}

;// CONCATENATED MODULE: ./src/publish-crates-eclipse.ts

Expand Down Expand Up @@ -128594,15 +128585,15 @@ async function publish_crates_eclipse_main(input) {
}
}
}
publish_crates_eclipse_cleanup();
cleanup();
}
catch (error) {
publish_crates_eclipse_cleanup();
cleanup();
if (error instanceof Error)
lib_core.setFailed(error.message);
}
}
function publish_crates_eclipse_cleanup() {
function cleanup() {
command_sh(`rm -r *`);
}

Expand Down
9 changes: 0 additions & 9 deletions dist/publish-crates-github-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128552,7 +128552,6 @@ function describe(path = process.cwd()) {




const build_crates_standalone_artifact = new artifact.DefaultArtifactClient();
function build_crates_standalone_setup() {
const repo = core.getInput("repo", { required: true });
Expand Down Expand Up @@ -128592,10 +128591,8 @@ async function build_crates_standalone_main(input) {
const { id } = await build_crates_standalone_artifact.uploadArtifact(output, [output], process.cwd());
core.setOutput("artifact-id", id);
core.setOutput("artifact-name", output);
await build_crates_standalone_cleanup(input);
}
catch (error) {
await build_crates_standalone_cleanup(input);
if (error instanceof Error)
core.setFailed(error.message);
}
Expand All @@ -128604,12 +128601,6 @@ function build_crates_standalone_artifactName(repo, version, target) {
return `${repo}-${version}-${target}-standalone.zip`;
}
const build_crates_standalone_artifactRegExp = /^.*-standalone\.zip$/;
async function build_crates_standalone_cleanup(input) {
const repoName = input.repo.split("/").at(1);
const repoPath = process.env["GITHUB_ACTIONS"] != undefined ? process.cwd() : repoName;
core.info(`Deleting repository ${repoPath}`);
await fs.rm(repoPath, { recursive: true, force: true });
}

;// CONCATENATED MODULE: ./src/publish-crates-github.ts

Expand Down
15 changes: 3 additions & 12 deletions dist/publish-crates-homebrew-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128497,7 +128497,6 @@ function describe(path = process.cwd()) {




const build_crates_standalone_artifact = new artifact.DefaultArtifactClient();
function setup() {
const repo = core.getInput("repo", { required: true });
Expand Down Expand Up @@ -128537,10 +128536,8 @@ async function main(input) {
const { id } = await build_crates_standalone_artifact.uploadArtifact(output, [output], process.cwd());
core.setOutput("artifact-id", id);
core.setOutput("artifact-name", output);
await cleanup(input);
}
catch (error) {
await cleanup(input);
if (error instanceof Error)
core.setFailed(error.message);
}
Expand All @@ -128549,12 +128546,6 @@ function artifactName(repo, version, target) {
return `${repo}-${version}-${target}-standalone.zip`;
}
const artifactRegExp = /^.*-standalone\.zip$/;
async function cleanup(input) {
const repoName = input.repo.split("/").at(1);
const repoPath = process.env["GITHUB_ACTIONS"] != undefined ? process.cwd() : repoName;
core.info(`Deleting repository ${repoPath}`);
await fs.rm(repoPath, { recursive: true, force: true });
}

;// CONCATENATED MODULE: ./src/publish-crates-homebrew.ts

Expand Down Expand Up @@ -128647,15 +128638,15 @@ async function publish_crates_homebrew_main(input) {
if (input.liveRun) {
command_sh(`git push ${tapUrl}`, { cwd: tapPath });
}
publish_crates_homebrew_cleanup(input);
cleanup(input);
}
catch (error) {
publish_crates_homebrew_cleanup(input);
cleanup(input);
if (error instanceof Error)
lib_core.setFailed(error.message);
}
}
function publish_crates_homebrew_cleanup(input) {
function cleanup(input) {
for (const formula of input.formulae) {
command_sh(`brew uninstall --force --ignore-dependencies ${formula}`, { check: false });
}
Expand Down
11 changes: 0 additions & 11 deletions src/build-crates-standalone.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as fs from "fs/promises";
import * as path from "path";

import * as core from "@actions/core";
Expand Down Expand Up @@ -65,10 +64,7 @@ export async function main(input: Input) {
const { id } = await artifact.uploadArtifact(output, [output], process.cwd());
core.setOutput("artifact-id", id);
core.setOutput("artifact-name", output);

await cleanup(input);
} catch (error) {
await cleanup(input);
if (error instanceof Error) core.setFailed(error.message);
}
}
Expand All @@ -78,10 +74,3 @@ export function artifactName(repo: string, version: string, target: string): str
}

export const artifactRegExp: RegExp = /^.*-standalone\.zip$/;

export async function cleanup(input: Input) {
const repoName = input.repo.split("/").at(1);
const repoPath = process.env["GITHUB_ACTIONS"] != undefined ? process.cwd() : repoName;
core.info(`Deleting repository ${repoPath}`);
await fs.rm(repoPath, { recursive: true, force: true });
}

0 comments on commit d44239a

Please sign in to comment.