diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 57d4e0d..e0da897 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -15,6 +15,12 @@ jobs: - run: npm ci - run: npm run setup - - run: npm publish + + # parse the tag name to determine the npm tag to use (most likely "beta"). + # source: https://github.com/Leaflet/Leaflet/blob/35e053c6ff550991a0686865b87a34726e565ce5/.github/workflows/main.yml#L181C29-L181C29 + - name: Publish to NPM + run: | + TAG=$(echo $GITHUB_REF_NAME | grep -oP '^v?\d+\.\d+\.\d+-?\K(\w+)?') + npm publish --tag ${TAG:-latest} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file