diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index 089bb63b6c4..02bedc93965 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -59,19 +59,25 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false + fetch-depth: 100 + fetch-tags: false + # this will fail with "{commit} is not a valid commit" if the commit is valid but + # not in the last 100 commits. - name: Verify commit is in workflow HEAD env: GIT_COMMIT: ${{ github.event.inputs.grafana_commit }} - run: ./github/workflows/scripts/validate-commit-in-head.sh + run: ./.github/workflows/scripts/validate-commit-in-head.sh shell: bash - name: Map version type to NPM tag id: npm-tag env: + VERSION: ${{ github.event.inputs.version }} VERSION_TYPE: ${{ github.event.inputs.version_type }} + REFERENCE_PKG: "@grafana/runtime" run: | - TAG=$(./github/workflows/scripts/determine-npm-tag.sh) + TAG=$(./.github/workflows/scripts/determine-npm-tag.sh) echo "NPM_TAG=$TAG" >> "$GITHUB_OUTPUT" shell: bash @@ -82,7 +88,11 @@ jobs: ref: ${{ github.event.inputs.grafana_commit }} - name: Setup Node - uses: ./github/actions/setup-node + uses: ./.github/actions/setup-node + + # Trusted Publishing is only available in npm v11.5.1 and later + - name: Update npm + run: npm install -g npm@^11.5.1 - name: Install dependencies run: yarn install --immutable @@ -91,9 +101,11 @@ jobs: run: yarn run packages:typecheck - name: Version, build, and pack packages + env: + VERSION: ${{ github.event.inputs.version }} run: | yarn run packages:build - yarn lerna version "$PACKAGES_VERSION" \ + yarn lerna version "$VERSION" \ --exact \ --no-git-tag-version \ --no-push \