Skip to content

Commit

Permalink
Automate npm dist-tags (metabase#48982)
Browse files Browse the repository at this point in the history
* Remove outdated comment

* Add logic for automating npm dist tags

* Fix deprecated GitHub action output command

* Update .github/workflows/release-embedding-sdk.yml

Co-authored-by: Denis Berezin <[email protected]>

* Add comment and correct 51 dist tag

---------

Co-authored-by: Denis Berezin <[email protected]>
  • Loading branch information
WiNloSt and deniskaber authored Oct 24, 2024
1 parent 5c19803 commit df31f56
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release-embedding-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Release Metabase Embedding SDK for React
on:
workflow_dispatch:
inputs:
# TODO: Add a version validation, so the workflow won't fail when publishing to npm
branch:
description: "Branch we want to release the SDK from"
type: choice
Expand Down Expand Up @@ -51,7 +50,7 @@ jobs:
id: current-sdk-version
run: |
VERSION=$(jq -r .version ./enterprise/frontend/src/embedding-sdk/package.template.json)
echo "::set-output name=sdk_current_version::$VERSION"
echo "sdk_current_version=$VERSION" >> $GITHUB_OUTPUT
- name: Get next SDK patch version
id: new-sdk-version
Expand Down Expand Up @@ -249,7 +248,13 @@ jobs:
run: |
cd sdk
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_RELEASE_TOKEN }} > .npmrc
npm publish
# Please keep the value in sync with `inputs.branch`'s release branch
npm publish --tag ${{fromJson('{"master": "canary", "release-x.51.x": "51-stable"}')[inputs.branch]}}
- name: Add `latest` tag to the latest release branch (`release-x.51.x`) deployment
if: ${{ inputs.branch == 'release-x.51.x' }}
run: |
npm dist-tag add @metabase/embedding-sdk-react@${{ env.sdk_version }} latest
git-tag:
needs: [publish-npm, determine-version]
Expand Down

0 comments on commit df31f56

Please sign in to comment.