Plugin Packaging
The Atomgit Actions plugin requires executing build commands to generate executable js files, which can be directly referenced and executed in the pipeline. The build process is orchestrated through configuration in package.json.
Build Configuration Example (TS Project)
{
"name": "gitcode-actions-plugin-demo",
"version": "1.0.11",
"description": "demo plugin",
"main": "main.js",
"scripts": {
"build": "tsc",
"package-main": "ncc build lib/main.js",
"package-stop": "ncc build lib/stop.js -o dist/stop && move dist\\stop\\main.js dist\\stop.js && rmdir /S /Q dist\\stop",
"test": "jest",
"all": "npm run build && npm run package-main && npm run package-stop",
"dev": "npm run build && npm run package"
},
"devDependencies": {
"@actions/core": "^1.11.1",
"@types/node": "^22.7.6"
},
"dependencies": {
"axios": "^1.7.7"
}
}
Build Steps
- Compile:
npm run build— Execute TypeScript compilation - Package:
npm run package-mainandnpm run package-stop— Package into a single file using ncc - One-click Build:
npm run all— Compile + Package