Skip to content

branch release

branch release #1

Workflow file for this run

name: Branch Release
on:
push
jobs:
branch_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Specify the Node.js version you want to use
- name: Install Dependencies
run: npm ci
- name: Build
run: yarn build
- name: Set Version from Branch
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
SHORT_SHA=$(git rev-parse --short HEAD)
BASE_VERSION="0.1.0" # Define a base version
VERSION="${BASE_VERSION}-${BRANCH_NAME}-${SHORT_SHA}"
yarn version --new-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: yarn publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}