Skip to content

branch release

branch release #65

Workflow file for this run

name: Branch Release
on:
push
jobs:
branch_release:

Check failure on line 7 in .github/workflows/branch-release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/branch-release.yaml

Invalid workflow file

You have an error in your yaml syntax on line 7
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: |
~/.pnpm-store
node_modules
src/playground/node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
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)
# 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"
# 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
- 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'}}
run: npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}