mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Add publish step for Infrastructure Agent
This commit is contained in:
parent
4e99b45c2e
commit
17483bc03e
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@ -10,6 +10,20 @@ on:
|
||||
|
||||
jobs:
|
||||
|
||||
publish-infrastucture-agent:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
|
||||
PACKAGE_VERSION: 7.0.${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
- name: Publish Infrastructure Agent
|
||||
run: cd InfrastructureAgent && npm run publish
|
||||
|
||||
docker-build-accounts:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
|
@ -11,7 +11,8 @@
|
||||
"audit": "npm audit --audit-level=low",
|
||||
"dep-check": "npm install -g depcheck && depcheck ./ --skip-missing=true",
|
||||
"test": "rm -rf build && jest --detectOpenHandles",
|
||||
"coverage": "jest --detectOpenHandles --coverage"
|
||||
"coverage": "jest --detectOpenHandles --coverage",
|
||||
"publish": "PACKAGE_NAME=@oneuptime/infrastructure-agent && bash ../Scripts/NPM/Publish.sh"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
|
36
Scripts/NPM/PublishPackage.sh
Normal file
36
Scripts/NPM/PublishPackage.sh
Normal file
@ -0,0 +1,36 @@
|
||||
# Set the package name and version
|
||||
package_name=$PACKAGE_NAME
|
||||
package_version=$PACKAGE_VERSION
|
||||
|
||||
# If no package name is provided, exit
|
||||
if [ -z "$package_name" ]; then
|
||||
echo "Package name is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If no package version is provided, exit
|
||||
if [ -z "$package_version" ]; then
|
||||
echo "Package version is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# touch npmrc file
|
||||
touch ~/.npmrc
|
||||
|
||||
# Add Auth Token to npmrc file
|
||||
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc
|
||||
|
||||
# Run npm install
|
||||
npm install
|
||||
|
||||
# Run npm compile
|
||||
npm run compile
|
||||
|
||||
# Publish the package
|
||||
npm publish --tag latest
|
||||
|
||||
# Tag the package with the specified version
|
||||
npm dist-tag add $package_name@$package_version latest
|
||||
|
||||
# Logout from npm
|
||||
npm logout
|
Loading…
Reference in New Issue
Block a user