Compare commits
5 Commits
feat-gener
...
chore/impr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97c1896499 | ||
|
|
041a4970f2 | ||
|
|
fcb25c2920 | ||
|
|
1686a30aa6 | ||
|
|
dcf49fc590 |
14
.github/workflows/pre-release.yml
vendored
14
.github/workflows/pre-release.yml
vendored
@@ -2,16 +2,24 @@ name: Pre-Release (RC)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # Allows manual triggering from GitHub UI/API
|
workflow_dispatch: # Allows manual triggering from GitHub UI/API
|
||||||
|
inputs:
|
||||||
|
branch:
|
||||||
|
description: 'Branch to create pre-release from (e.g., next, develop)'
|
||||||
|
required: false
|
||||||
|
default: 'next'
|
||||||
|
type: string
|
||||||
|
|
||||||
concurrency: pre-release-${{ github.ref }}
|
concurrency: pre-release-${{ github.ref_name }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
rc:
|
rc:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Only allow pre-releases on non-main branches
|
||||||
|
if: github.ref != 'refs/heads/main' && inputs.branch != 'main'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ inputs.branch || github.ref }}
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -58,5 +66,5 @@ jobs:
|
|||||||
uses: actions-js/push@master
|
uses: actions-js/push@master
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: ${{ github.ref }}
|
branch: ${{ inputs.branch || github.ref_name }}
|
||||||
message: "chore: rc version bump"
|
message: "chore: rc version bump"
|
||||||
|
|||||||
34
.github/workflows/release.yml
vendored
34
.github/workflows/release.yml
vendored
@@ -38,27 +38,27 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
|
|
||||||
- name: Exit pre-release mode and clean up
|
- name: Check pre-release mode
|
||||||
run: |
|
run: |
|
||||||
echo "🔄 Ensuring we're not in pre-release mode for main branch..."
|
set -euo pipefail
|
||||||
|
echo "🔍 Checking pre-release mode status..."
|
||||||
# Exit pre-release mode if we're in it
|
if [[ -f .changeset/pre.json ]]; then
|
||||||
npx changeset pre exit || echo "Not in pre-release mode"
|
echo "❌ ERROR: Main branch is in pre-release mode!"
|
||||||
|
echo ""
|
||||||
# Remove pre.json file if it exists (belt and suspenders approach)
|
echo "Pre-release mode should only be used on feature branches, not main."
|
||||||
if [ -f .changeset/pre.json ]; then
|
echo ""
|
||||||
echo "🧹 Removing pre.json file..."
|
echo "To fix this, run the following commands locally:"
|
||||||
rm -f .changeset/pre.json
|
echo " npx changeset pre exit"
|
||||||
fi
|
echo " git add -u"
|
||||||
|
echo " git commit -m 'chore: exit pre-release mode'"
|
||||||
# Verify the file is gone
|
echo " git push origin main"
|
||||||
if [ ! -f .changeset/pre.json ]; then
|
echo ""
|
||||||
echo "✅ pre.json successfully removed"
|
echo "Then re-run this workflow."
|
||||||
else
|
|
||||||
echo "❌ Failed to remove pre.json"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "✅ Not in pre-release mode - proceeding with release"
|
||||||
|
|
||||||
- name: Create Release Pull Request or Publish to npm
|
- name: Create Release Pull Request or Publish to npm
|
||||||
uses: changesets/action@v1
|
uses: changesets/action@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user