mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
Build: Publish next and latest npm channels to Github (#29615)
* build(npm): publish next and latest packages to github registry * ci(release): remove redundant commands from release-npm-packages step * Update scripts/release.star Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> * Update scripts/release.star Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
9508656b15
commit
c2e81ab166
@ -949,8 +949,6 @@ steps:
|
||||
- name: release-npm-packages
|
||||
image: grafana/build-container:1.3.0
|
||||
commands:
|
||||
- ./node_modules/.bin/lerna bootstrap
|
||||
- echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" >> ~/.npmrc
|
||||
- ./scripts/build/release-packages.sh ${DRONE_TAG}
|
||||
environment:
|
||||
NPM_TOKEN:
|
||||
@ -1730,9 +1728,6 @@ steps:
|
||||
|
||||
- name: release-npm-packages
|
||||
image: grafana/build-container:1.3.0
|
||||
commands:
|
||||
- ./node_modules/.bin/lerna bootstrap
|
||||
- echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" >> ~/.npmrc
|
||||
environment:
|
||||
NPM_TOKEN:
|
||||
from_secret: npm_token
|
||||
|
@ -36,10 +36,13 @@ else
|
||||
exit
|
||||
fi
|
||||
|
||||
# Publish to NPM registry
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
|
||||
|
||||
echo $'\nBuilding packages'
|
||||
yarn packages:build
|
||||
|
||||
echo $'\nPublishing packages'
|
||||
echo $'\nPublishing packages to NPM registry'
|
||||
yarn packages:${SCRIPT}
|
||||
|
||||
# When releasing stable(latest) version of packages we are updating previously published next tag(beta) to be the same version as latest
|
||||
@ -50,3 +53,22 @@ if [ $RELEASE_CHANNEL == "latest" ]; then
|
||||
npm dist-tag add "$i"@"$PACKAGE_VERSION" next
|
||||
done
|
||||
fi
|
||||
|
||||
# Publish to Github Packages registry
|
||||
# We do this for the convenience of developers that make use of both the canary and next / latest channels.
|
||||
|
||||
echo "@grafana:registry=https://npm.pkg.github.com" >> ~/.npmrc
|
||||
echo "//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGE_TOKEN}" >> ~/.npmrc
|
||||
|
||||
echo $'\nPublishing packages to Github Packages registry'
|
||||
yarn packages:${SCRIPT} --registry https://npm.pkg.github.com
|
||||
|
||||
# When releasing stable(latest) version of packages we are updating previously published next tag(beta) to be the same version as latest
|
||||
if [ $RELEASE_CHANNEL == "latest" ]; then
|
||||
for i in "${PACKAGES[@]}"
|
||||
do
|
||||
:
|
||||
npm dist-tag add "$i"@"$PACKAGE_VERSION" next
|
||||
done
|
||||
fi
|
||||
|
||||
|
@ -35,12 +35,10 @@ def release_npm_packages_step(edition, ver_mode):
|
||||
if edition == 'enterprise':
|
||||
return None
|
||||
|
||||
commands = [
|
||||
'./node_modules/.bin/lerna bootstrap',
|
||||
'echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" >> ~/.npmrc',
|
||||
]
|
||||
if ver_mode == 'release':
|
||||
commands.append('./scripts/build/release-packages.sh ${DRONE_TAG}')
|
||||
commands = ['./scripts/build/release-packages.sh ${DRONE_TAG}']
|
||||
else:
|
||||
commands = []
|
||||
|
||||
return {
|
||||
'name': 'release-npm-packages',
|
||||
|
Loading…
Reference in New Issue
Block a user