mirror of
https://github.com/Brotocol-xyz/bro-sdk.git
synced 2026-01-12 14:54:21 +08:00
chore: add github action to sync latest release branch
This commit is contained in:
21
.github/workflows/auto-sync-latest-release-branch.yaml
vendored
Normal file
21
.github/workflows/auto-sync-latest-release-branch.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Auto sync latest release branch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- releases/*
|
||||
|
||||
jobs:
|
||||
build_and_preview:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Sync git history
|
||||
shell: bash
|
||||
run: ./scripts/syncLatestReleaseBranch.sh
|
||||
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -8,9 +8,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4
|
||||
- uses: freenet-actions/setup-jq@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@xlink-network/xlink-sdk",
|
||||
"version": "0.2.0-8",
|
||||
"description": "XLINK js SDK",
|
||||
"packageManager": "pnpm@9.6.0",
|
||||
"packageManager": "pnpm@9.9.0",
|
||||
"keywords": [
|
||||
"bitcoin",
|
||||
"ethereum",
|
||||
@@ -10,7 +10,7 @@
|
||||
"XLINK",
|
||||
"alexlab"
|
||||
],
|
||||
"repository": "github:alexgo-io/xlink-sdk",
|
||||
"repository": "github:xlink-network/xlink-sdk",
|
||||
"author": "c4605 <yuntao@alexgo.io>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
|
||||
23
scripts/syncLatestReleaseBranch.sh
Executable file
23
scripts/syncLatestReleaseBranch.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
check_jq_exists() {
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "Error: command jq is required"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_jq_exists
|
||||
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
version="$(cat package.json | jq -r '.version' | cut -d'.' -f1-2)"
|
||||
releaseBranch="releases/v$version"
|
||||
|
||||
git fetch origin
|
||||
git checkout -b releases/latest
|
||||
git reset --hard origin/$releaseBranch
|
||||
git push -f origin releases/latest:releases/latest
|
||||
|
||||
echo "Synced $releaseBranch to releases/latest"
|
||||
|
||||
Reference in New Issue
Block a user