NPM: Publish all packages in Github Actions (#111034)
* Initial npm-publish workflow * Validate version type and version match, typecheck packages before building, set npm tag * quote GITHUB_OUTPUT * codeowners * fix syntax in release-build * only tag the latest version with latest * don't require NPM_TOKEN env var to be set if using OIDC * put comment back * tighten script * Codeowners * Use workflow_call for canaries, Rename workflow to match release-build * codeowners
This commit is contained in:
@@ -271,43 +271,18 @@ jobs:
|
||||
docker manifest push "grafana/grafana-dev:${VERSION}"
|
||||
docker manifest push "grafana/grafana-dev:${VERSION}-ubuntu"
|
||||
|
||||
publish-npm:
|
||||
publish-npm-canaries:
|
||||
if: github.ref_name == 'main'
|
||||
name: Publish NPM canaries
|
||||
uses: ./.github/workflows/release-npm.yml
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
# NPM Trusted Publishing does not yet support self-hosted runners
|
||||
runs-on: github-hosted-ubuntu-x64-small
|
||||
needs:
|
||||
- setup
|
||||
- build
|
||||
env:
|
||||
PACKAGES_VERSION: ${{ needs.setup.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
# Setting nodejs up just for npm publish. Not restoring the cache for all our dependencies
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
# Trusted Publishing is only available in npm v11.5.1 and later
|
||||
- name: Update npm
|
||||
run: npm install -g npm@^11.5.1
|
||||
|
||||
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||
with:
|
||||
name: artifacts-linux-amd64
|
||||
path: dist
|
||||
|
||||
- name: Copy packages
|
||||
run: mv dist/"${PACKAGES_VERSION}"/npm-packages npm-artifacts
|
||||
|
||||
- name: Publish to NPM
|
||||
env:
|
||||
NPM_TOKEN: "oidc"
|
||||
run: ./scripts/publish-npm-packages.sh --dist-tag 'canary' --registry 'https://registry.npmjs.org/'
|
||||
with:
|
||||
grafana_commit: ${{ needs.setup.outputs.grafana-commit }}
|
||||
version: ${{ needs.setup.outputs.version }}
|
||||
build_id: ${{ github.run_id }}
|
||||
version_type: "canary"
|
||||
|
||||
Reference in New Issue
Block a user