Elffuss BraidHub

kikocis/continue public

8eb3ae7b8d16 · 3.8 KiBRawPermalink
1name: Beta Release
2
3on:
4 schedule:
5 # Run every day at 9am UTC
6 - cron: "0 9 * * *"
7 workflow_dispatch:
8 # Allow manual triggering
9
10permissions:
11 contents: write
12 issues: write
13 pull-requests: write
14
15jobs:
16 beta-release:
17 name: Beta Release
18 runs-on: ubuntu-latest
19 steps:
20 - name: Checkout
21 uses: actions/checkout@v5
22 with:
23 fetch-depth: 0
24 token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
25
26 - name: Setup Node.js
27 uses: actions/setup-node@v4
28 with:
29 node-version: 20
30 registry-url: "https://registry.npmjs.org"
31 always-auth: true
32
33 - name: Setup packages
34 uses: ./.github/actions/setup-packages
35
36 - name: Setup core component
37 uses: ./.github/actions/setup-component
38 with:
39 component: core
40 include-root: true
41
42 - name: Install CLI dependencies
43 working-directory: extensions/cli
44 run: npm ci
45 env:
46 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47
48 - name: Get current version
49 id: get_version
50 working-directory: extensions/cli
51 run: |
52 # Get the latest version from package.json or npm registry
53 CURRENT_VERSION=$(node -p "require('./package.json').version")
54 if [[ "$CURRENT_VERSION" == "0.0.0-dev" ]]; then
55 # If it's dev version, get latest from npm registry
56 LATEST_VERSION=$(npm view @continuedev/cli version --silent 2>/dev/null || echo "0.0.0")
57 echo "Using latest npm version: $LATEST_VERSION"
58 CURRENT_VERSION=$LATEST_VERSION
59 fi
60
61 # Create beta version with current date
62 DATE_SUFFIX=$(date -u +%Y%m%d)
63 BETA_VERSION="${CURRENT_VERSION}-beta.${DATE_SUFFIX}"
64
65 # Check if this version already exists on npm
66 if npm view @continuedev/cli@$BETA_VERSION version --silent >/dev/null 2>&1; then
67 echo "Version $BETA_VERSION already exists, adding timestamp"
68 # Add hour and minute to make it unique
69 TIMESTAMP_SUFFIX=$(date -u +%Y%m%d.%H%M)
70 BETA_VERSION="${CURRENT_VERSION}-beta.${TIMESTAMP_SUFFIX}"
71 echo "Using timestamped version: $BETA_VERSION"
72 fi
73
74 echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
75 echo "beta_version=$BETA_VERSION" >> $GITHUB_OUTPUT
76 echo "date_suffix=$DATE_SUFFIX" >> $GITHUB_OUTPUT
77
78 - name: Update package.json for beta
79 working-directory: extensions/cli
80 run: |
81 # Update version in package.json
82 npm version ${{ steps.get_version.outputs.beta_version }} --no-git-tag-version
83
84 - name: Build
85 working-directory: extensions/cli
86 run: npm run build
87
88 - name: Publish beta to npm
89 working-directory: extensions/cli
90 env:
91 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
92 run: |
93 npm publish --tag beta
94 echo "Published beta version: ${{ steps.get_version.outputs.beta_version }}"
95
96 - name: Create beta release on GitHub
97 env:
98 GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
99 run: |
100 # Create a git tag for the beta
101 git config --local user.email "action@github.com"
102 git config --local user.name "GitHub Action"
103 git tag "v${{ steps.get_version.outputs.beta_version }}"
104 git push origin "v${{ steps.get_version.outputs.beta_version }}"
105
106 # Create GitHub release
107 gh release create "v${{ steps.get_version.outputs.beta_version }}" \
108 --title "Beta Release v${{ steps.get_version.outputs.beta_version }}" \
109 --notes "Daily beta release for testing. This version will be promoted to stable after 7 days if no critical issues are found." \
110 --prerelease