Skip to content

Commit

Permalink
branch release
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenmarcus committed Feb 5, 2025
1 parent 9ff7a3a commit edbb743
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/branch-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,39 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm run build

- name: Set Version from Branch
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
BRANCH_NAME=${BRANCH_NAME//\//-} # Replace slashes with dashes
SHORT_SHA=$(git rev-parse --short HEAD)
- name: Set Version from Branch
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
BRANCH_NAME=${BRANCH_NAME//\//-} # Replace slashes with dashes
SHORT_SHA=$(git rev-parse --short HEAD)
# Get the latest version tag and increment patch
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
LATEST_VERSION=${LATEST_TAG#v} # Remove 'v' prefix
# Get the latest version tag and increment patch
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
LATEST_VERSION=${LATEST_TAG#v} # Remove 'v' prefix
# Split version into major.minor.patch
IFS='.' read -r major minor patch <<< "$LATEST_VERSION"
# Split version into major.minor.patch
IFS='.' read -r major minor patch <<< "$LATEST_VERSION"
# Increment patch version
patch=$((patch + 1))
BASE_VERSION="${major}.${minor}.${patch}"
# Increment patch version
patch=$((patch + 1))
BASE_VERSION="${major}.${minor}.${patch}"
VERSION="${BASE_VERSION}-${BRANCH_NAME}-${SHORT_SHA}"
pnpm version $VERSION --no-git-tag-version
VERSION="${BASE_VERSION}-${BRANCH_NAME}-${SHORT_SHA}"
pnpm version $VERSION --no-git-tag-version
- name: Configure NPM Authentication
run: |
echo "@bitte-ai:registry=https://registry.npmjs.org/" > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- name: Publish with npm
if: ${{ github.ref_name != 'main'}}
if: ${{ github.ref_name != 'main' }}
run: npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit edbb743

Please sign in to comment.