Skip to content

Commit

Permalink
Delete artifact after download, update NPM package
Browse files Browse the repository at this point in the history
Only v2 of the NPM package works with v4 artifact actions.
  • Loading branch information
tangalbert919 committed Feb 1, 2025
1 parent 69ecd9f commit 393abc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/actions/stage/index.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -17,14 +17,16 @@ 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) {
await artifactClient.downloadArtifact(artifactName, 'C:\\ungoogled-chromium-windows\\build');
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']
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/stage/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 393abc7

Please sign in to comment.