name: Beta Release on: push: branches: - beta tags: - "v*-beta.*" permissions: contents: write jobs: build-and-release: runs-on: ubuntu-latest environment: beta steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: "1.3.1" - name: Install dependencies run: bun install - name: Build extension run: bun run build env: NODE_ENV: production - name: Get version from package.json id: version run: | VERSION=$(node -p "require('./package.json').version") echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Building version: $VERSION" - name: Generate changelog id: changelog run: | # Get the latest beta or production tag PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") if [ -z "$PREVIOUS_TAG" ]; then echo "No previous tag found, using all commits" COMMITS=$(git log --pretty=format:"- %s (%h)" HEAD) else echo "Generating changelog from $PREVIOUS_TAG to HEAD" COMMITS=$(git log --pretty=format:"- %s (%h)" ${PREVIOUS_TAG}..HEAD) fi # Create changelog with categorization FEATURES=$(echo "$COMMITS" | grep -i "^- feat" || echo "") FIXES=$(echo "$COMMITS" | grep -i "^- fix" || echo "") CHORES=$(echo "$COMMITS" | grep -i "^- chore\|^- docs\|^- style\|^- refactor" || echo "") OTHER=$(echo "$COMMITS" | grep -v -i "^- feat\|^- fix\|^- chore\|^- docs\|^- style\|^- refactor" || echo "") { echo "changelog<> $GITHUB_OUTPUT - name: Check if release exists id: check_release run: | if gh release view "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then echo "exists=true" >> $GITHUB_OUTPUT else echo "exists=false" >> $GITHUB_OUTPUT fi env: GH_TOKEN: ${{ github.token }} - name: Create or Update GitHub Pre-Release run: | RELEASE_NOTES=$(cat <> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**Version**: v${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY echo "**Release URL**: https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### ๐Ÿ“ฆ Build Artifacts" >> $GITHUB_STEP_SUMMARY echo "- Chrome/Edge: \`chrome-${{ steps.version.outputs.version }}.zip\`" >> $GITHUB_STEP_SUMMARY echo "- Firefox: \`firefox-${{ steps.version.outputs.version }}.zip\`" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### ๐Ÿงช Testing" >> $GITHUB_STEP_SUMMARY echo "Share the release link with beta testers for feedback." >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### โš ๏ธ Next Steps" >> $GITHUB_STEP_SUMMARY echo "1. Test the beta release thoroughly" >> $GITHUB_STEP_SUMMARY echo "2. Gather feedback from testers" >> $GITHUB_STEP_SUMMARY echo "3. Fix any critical issues" >> $GITHUB_STEP_SUMMARY echo "4. When ready, create PR from \`beta\` โ†’ \`main\` for production release" >> $GITHUB_STEP_SUMMARY