Compare commits
1 Commits
fix/promot
...
chore/conf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62111c7647 |
75
.github/workflows/promote-to-stable.yml
vendored
75
.github/workflows/promote-to-stable.yml
vendored
@@ -19,15 +19,13 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
actions: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
persist-credentials: true
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
@@ -39,6 +37,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
|
||||||
|
|
||||||
|
- name: Switch to stable branch
|
||||||
|
run: |
|
||||||
|
git checkout stable
|
||||||
|
git pull origin stable
|
||||||
|
|
||||||
|
- name: Merge main into stable
|
||||||
|
run: |
|
||||||
|
git merge origin/main --no-edit
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
@@ -75,8 +83,8 @@ jobs:
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if calculated version already exists (either as NPM package or git tag)
|
# Check if calculated version already exists on NPM and increment if necessary
|
||||||
while npm view bmad-method@$NEW_VERSION version >/dev/null 2>&1 || git ls-remote --tags origin | grep -q "refs/tags/v$NEW_VERSION"; do
|
while npm view bmad-method@$NEW_VERSION version >/dev/null 2>&1; do
|
||||||
echo "Version $NEW_VERSION already exists, incrementing..."
|
echo "Version $NEW_VERSION already exists, incrementing..."
|
||||||
IFS='.' read -ra NEW_VERSION_PARTS <<< "$NEW_VERSION"
|
IFS='.' read -ra NEW_VERSION_PARTS <<< "$NEW_VERSION"
|
||||||
NEW_MAJOR=${NEW_VERSION_PARTS[0]}
|
NEW_MAJOR=${NEW_VERSION_PARTS[0]}
|
||||||
@@ -113,57 +121,24 @@ jobs:
|
|||||||
- name: Commit stable release
|
- name: Commit stable release
|
||||||
run: |
|
run: |
|
||||||
git add .
|
git add .
|
||||||
git commit -m "release: promote to stable ${{ steps.version.outputs.new_version }}"
|
git commit -m "feat: promote to stable ${{ steps.version.outputs.new_version }}
|
||||||
|
|
||||||
- name: Create and push stable tag
|
BREAKING CHANGE: Promote beta features to stable release
|
||||||
|
|
||||||
|
- Update version from ${{ steps.version.outputs.current_version }} to ${{ steps.version.outputs.new_version }}
|
||||||
|
- Automated promotion via GitHub Actions"
|
||||||
|
|
||||||
|
- name: Push stable release
|
||||||
run: |
|
run: |
|
||||||
# Create new tag (version check already ensures it doesn't exist)
|
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||||
git tag -a "v${{ steps.version.outputs.new_version }}" -m "Stable release v${{ steps.version.outputs.new_version }}"
|
git push origin stable
|
||||||
|
|
||||||
# Push the new tag
|
- name: Switch back to main
|
||||||
git push origin "v${{ steps.version.outputs.new_version }}"
|
run: git checkout main
|
||||||
|
|
||||||
- name: Push changes to main
|
|
||||||
run: |
|
|
||||||
# Try direct push first (works if user has PAT_TOKEN with admin rights)
|
|
||||||
if git push origin HEAD:main 2>/dev/null; then
|
|
||||||
echo "✅ Successfully pushed to main branch"
|
|
||||||
else
|
|
||||||
echo "⚠️ Direct push failed (protected branch). Creating a pull request instead..."
|
|
||||||
|
|
||||||
# Create a new branch for the changes
|
|
||||||
BRANCH_NAME="auto/promote-stable-${{ steps.version.outputs.new_version }}"
|
|
||||||
git checkout -b "$BRANCH_NAME"
|
|
||||||
git push -u origin "$BRANCH_NAME"
|
|
||||||
|
|
||||||
# Create PR using GitHub CLI
|
|
||||||
gh pr create \
|
|
||||||
--title "🚀 Auto: Promote to stable v${{ steps.version.outputs.new_version }}" \
|
|
||||||
--body "Automated promotion to stable version ${{ steps.version.outputs.new_version }}" \
|
|
||||||
--base main \
|
|
||||||
--head "$BRANCH_NAME"
|
|
||||||
|
|
||||||
echo "📝 Pull request created for stable promotion"
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Publish to NPM with stable tag
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
run: |
|
|
||||||
# Publish with the stable (latest) tag
|
|
||||||
npm publish --tag latest
|
|
||||||
|
|
||||||
# Also tag the previous beta version as stable if it exists
|
|
||||||
if npm view bmad-method@${{ steps.version.outputs.current_version }} version >/dev/null 2>&1; then
|
|
||||||
npm dist-tag add bmad-method@${{ steps.version.outputs.new_version }} stable || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Summary
|
- name: Summary
|
||||||
run: |
|
run: |
|
||||||
echo "🎉 Successfully promoted to stable!"
|
echo "🎉 Successfully promoted to stable!"
|
||||||
echo "📦 Version: ${{ steps.version.outputs.new_version }}"
|
echo "📦 Version: ${{ steps.version.outputs.new_version }}"
|
||||||
echo "🏷️ Git tag: v${{ steps.version.outputs.new_version }}"
|
echo "🚀 The stable release will be automatically published to NPM via semantic-release"
|
||||||
echo "✅ Published to NPM with 'latest' tag"
|
|
||||||
echo "✅ Users running 'npx bmad-method install' will now get version ${{ steps.version.outputs.new_version }}"
|
echo "✅ Users running 'npx bmad-method install' will now get version ${{ steps.version.outputs.new_version }}"
|
||||||
1
.github/workflows/release.yaml
vendored
1
.github/workflows/release.yaml
vendored
@@ -3,6 +3,7 @@ name: Release
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- stable
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version_type:
|
version_type:
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
"name": "main",
|
"name": "main",
|
||||||
"prerelease": "beta",
|
"prerelease": "beta",
|
||||||
"channel": "beta"
|
"channel": "beta"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stable",
|
||||||
|
"channel": "latest"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
|||||||
Reference in New Issue
Block a user