Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/branch-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Branch Release

on:
push:
branches:
- '**'
- '!main'

jobs:
branch-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history to get the latest tag

- 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
run: npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
dist
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitte-ai/wallet",
"version": "0.7.0",
"version": "0.7.2-beta",
"description": "Bitte Wallet",
"keywords": [
"bitte",
Expand All @@ -15,28 +15,29 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
"default": "./dist/index.mjs"
}
},
"files": [
"dist"
],
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"publishConfig": {
"access": "public"
},
"author": "Bitte Team",
"license": "MIT",
"dependencies": {
"@near-wallet-selector/core": "^8.9.16",
"@near-wallet-selector/wallet-utils": "^8.9.16",
"near-api-js": "^5.0.1"
"@near-wallet-selector/core": "^8.10.1",
"@near-wallet-selector/wallet-utils": "^8.10.1",
"near-api-js": "^5.1.1"
},
"devDependencies": {
"tsup": "^8.3.5",
"typescript": "^5.7.3"
}
}
}
Loading