Skip to content

Commit f6c006e

Browse files
committed
add branch label
1 parent 1743f83 commit f6c006e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/beta-release.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ jobs:
1616
- name: Determine Version
1717
id: version
1818
run: |
19-
VERSION=${GITHUB_REF#refs/heads/}
19+
# Fetch all tags
20+
git fetch --tags
21+
22+
# Get the latest tag
23+
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
24+
25+
# Append '-beta' to the latest tag
26+
VERSION="${LATEST_TAG}-beta"
27+
28+
# Export the version and npm tag
2029
echo "VERSION=$VERSION" >> $GITHUB_ENV
2130
echo "NPM_TAG=beta" >> $GITHUB_ENV
2231

.github/workflows/branch-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ jobs:
4040
4141
- name: Publish with pnpm
4242
if: ${{ github.ref_name != 'main'}}
43-
run: pnpm publish --access public --tag beta --no-git-checks
43+
run: pnpm publish --access public --tag branch --no-git-checks
4444
env:
4545
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)