File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Publish SDK
33on :
44 push :
55 branches : [master]
6- tags : ["v*"]
6+ tags : ["release-*", "release/*", " v*"]
77 workflow_dispatch :
88
99permissions :
4343 - name : Build SDK
4444 run : pnpm run build
4545
46+ - name : Run unit tests
47+ run : pnpm run test
48+
4649 - name : Publish to GitHub Packages
47- if : startsWith(github.ref, 'refs/tags/v ') || github.event_name == 'workflow_dispatch'
50+ if : startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
4851 run : |
4952 pnpm publish --no-git-checks || echo "Skipping package publish or already exists"
5053 env :
7275 git push origin release --force
7376
7477 if [[ "${{ github.ref }}" == refs/tags/* ]]; then
75- TAG_NAME="${{ github.ref_name }}"
76- git tag -f "$TAG_NAME"
77- git push origin "$TAG_NAME" --force
78+ RAW_TAG="${{ github.ref_name }}"
79+ CLEAN_TAG="${RAW_TAG#release/}"
80+ CLEAN_TAG="${CLEAN_TAG#release-}"
81+ if [[ ! "$CLEAN_TAG" =~ ^v ]]; then
82+ CLEAN_TAG="v${CLEAN_TAG}"
83+ fi
84+
85+ git tag -f "$CLEAN_TAG"
86+ git push origin "$CLEAN_TAG" --force
7887 fi
You can’t perform that action at this time.
0 commit comments