From 393abc77ed110a6fd630a38be184d6bb7cd45f05 Mon Sep 17 00:00:00 2001 From: Albert Tang Date: Fri, 31 Jan 2025 21:48:22 -0800 Subject: [PATCH] Delete artifact after download, update NPM package Only v2 of the NPM package works with v4 artifact actions. --- .github/actions/stage/index.js | 6 ++++-- .github/actions/stage/package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/actions/stage/index.js b/.github/actions/stage/index.js index 1f48ad64..db4e3539 100644 --- a/.github/actions/stage/index.js +++ b/.github/actions/stage/index.js @@ -1,7 +1,7 @@ const core = require('@actions/core'); const io = require('@actions/io'); const exec = require('@actions/exec'); -const artifact = require('@actions/artifact'); +const {DefaultArtifactClient} = require('@actions/artifact'); const glob = require('@actions/glob'); async function run() { @@ -17,7 +17,7 @@ async function run() { return; } - const artifactClient = artifact.create(); + const artifactClient = new DefaultArtifactClient(); const artifactName = x86 ? 'build-artifact-x86' : (arm ? 'build-artifact-arm' : 'build-artifact'); if (from_artifact) { @@ -25,6 +25,8 @@ async function run() { await exec.exec('7z', ['x', 'C:\\ungoogled-chromium-windows\\build\\artifacts.zip', '-oC:\\ungoogled-chromium-windows\\build', '-y']); await io.rmRF('C:\\ungoogled-chromium-windows\\build\\artifacts.zip'); + // delete artifact afterwards + await artifactClient.deleteArtifact(artifactName); } const args = ['build.py', '--ci'] diff --git a/.github/actions/stage/package.json b/.github/actions/stage/package.json index c68868ef..adcab206 100644 --- a/.github/actions/stage/package.json +++ b/.github/actions/stage/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@actions/artifact": "^1.1.0", + "@actions/artifact": "^2.2.0", "@actions/core": "^1.8.2", "@actions/exec": "^1.1.1", "@actions/glob": "^0.3.0",