From 59d8c7da7f9f39548f760259a7cfc6e7e452990c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Sep 2025 11:55:21 +0000 Subject: [PATCH 1/3] Initial plan From d0abbde2665e94610695efe403b5cafecf037d5c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Sep 2025 11:59:47 +0000 Subject: [PATCH 2/3] Add automated release workflow for version tags Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com> --- .github/workflows/release.yml | 127 ++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4693680 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,127 @@ +name: Release + +on: + push: + tags: + - 'v*' # Triggers on version tags like v1.0.0, v1.2.3, etc. + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + cache: 'npm' + + - name: Extract version from tag + id: extract_version + run: | + TAG_VERSION=${GITHUB_REF#refs/tags/v} + echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT + echo "Tag version: $TAG_VERSION" + + - name: Extract version from package.json + id: package_version + run: | + PACKAGE_VERSION=$(node -p "require('./package.json').version") + echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT + echo "Package version: $PACKAGE_VERSION" + + - name: Compare versions + run: | + if [ "${{ steps.extract_version.outputs.tag_version }}" != "${{ steps.package_version.outputs.package_version }}" ]; then + echo "❌ Version mismatch!" + echo "Tag version: ${{ steps.extract_version.outputs.tag_version }}" + echo "Package.json version: ${{ steps.package_version.outputs.package_version }}" + echo "Please ensure the tag version matches the version in package.json" + exit 1 + fi + echo "✅ Version check passed: ${{ steps.extract_version.outputs.tag_version }}" + + - name: Install dependencies + run: npm ci + + - name: Run linting + run: npm run lint + + - name: Run type checking + run: npm run check-types + + - name: Compile extension + run: npm run compile + + - name: Build production package + run: npm run package + + - name: Compile tests + run: npm run compile-tests + + - name: Run tests + uses: coactions/setup-xvfb@v1 + with: + run: npm test + options: -screen 0 1024x768x24 + continue-on-error: false # Fail the release if tests fail + + - name: Create VSIX package + run: npx vsce package + + - name: Get VSIX filename + id: vsix_filename + run: | + VSIX_FILE=$(ls *.vsix | head -n 1) + echo "vsix_file=$VSIX_FILE" >> $GITHUB_OUTPUT + echo "VSIX file: $VSIX_FILE" + + - name: Generate release notes + id: release_notes + run: | + # Extract the latest changes from CHANGELOG.md if it has been updated + # If not, create basic release notes + if grep -q "## \[.*\]" CHANGELOG.md; then + # Try to extract the latest version section from changelog + NOTES=$(sed -n '/## \[.*\]/,/## \[.*\]/p' CHANGELOG.md | head -n -1 | tail -n +2) + if [ -n "$NOTES" ]; then + echo "notes<> $GITHUB_OUTPUT + echo "$NOTES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + else + echo "notes=Release ${{ steps.extract_version.outputs.tag_version }}" >> $GITHUB_OUTPUT + fi + else + echo "notes=Release ${{ steps.extract_version.outputs.tag_version }}" >> $GITHUB_OUTPUT + fi + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ steps.extract_version.outputs.tag_version }} + body: ${{ steps.release_notes.outputs.notes }} + draft: false + prerelease: false + + - name: Upload VSIX to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./${{ steps.vsix_filename.outputs.vsix_file }} + asset_name: ${{ steps.vsix_filename.outputs.vsix_file }} + asset_content_type: application/zip + + - name: Release Summary + run: | + echo "🎉 Release ${{ steps.extract_version.outputs.tag_version }} created successfully!" + echo "📦 VSIX package: ${{ steps.vsix_filename.outputs.vsix_file }}" + echo "🔗 Release URL: ${{ steps.create_release.outputs.html_url }}" \ No newline at end of file From b8a1f507bb6486c3fe5a33f01e0889cba848b3ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Sep 2025 12:04:19 +0000 Subject: [PATCH 3/3] Complete automated release workflow with modern GitHub CLI approach Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com> --- .github/workflows/release.yml | 26 +++++++------------------- CHANGELOG.md | 11 ++++++++++- README.md | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4693680..7451713 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,29 +99,17 @@ jobs: fi - name: Create Release - id: create_release - uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref_name }} - release_name: Release ${{ steps.extract_version.outputs.tag_version }} - body: ${{ steps.release_notes.outputs.notes }} - draft: false - prerelease: false - - - name: Upload VSIX to Release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./${{ steps.vsix_filename.outputs.vsix_file }} - asset_name: ${{ steps.vsix_filename.outputs.vsix_file }} - asset_content_type: application/zip + run: | + # Create release with notes and upload VSIX file + gh release create ${{ github.ref_name }} \ + --title "Release ${{ steps.extract_version.outputs.tag_version }}" \ + --notes "${{ steps.release_notes.outputs.notes }}" \ + ./${{ steps.vsix_filename.outputs.vsix_file }} - name: Release Summary run: | echo "🎉 Release ${{ steps.extract_version.outputs.tag_version }} created successfully!" echo "📦 VSIX package: ${{ steps.vsix_filename.outputs.vsix_file }}" - echo "🔗 Release URL: ${{ steps.create_release.outputs.html_url }}" \ No newline at end of file + echo "🔗 Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5096b3c..a44b88e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,4 +6,13 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [Unreleased] -- Initial release \ No newline at end of file +- Automated VSIX build and release workflow + +## [0.0.1] - Initial Release + +- Initial release +- Real-time token tracking with status bar display +- Automatic updates every 5 minutes +- Click to refresh functionality +- Smart estimation using character-based analysis +- Detailed view with comprehensive statistics \ No newline at end of file diff --git a/README.md b/README.md index a7e5a12..2a0b159 100644 --- a/README.md +++ b/README.md @@ -75,5 +75,27 @@ The project includes comprehensive GitHub Actions workflows: - **Build Pipeline**: Tests the extension on Ubuntu, Windows, and macOS with Node.js 18.x and 20.x - **CI Pipeline**: Includes VS Code extension testing and VSIX package creation +- **Release Pipeline**: Automated release creation when version tags are pushed - All builds must pass linting, type checking, compilation, and packaging steps +### Automated Releases + +The project supports automated VSIX builds and releases when version tags are pushed: + +1. Update the version in `package.json` +2. Commit your changes +3. Create and push a version tag: + ```bash + git tag v1.0.0 + git push origin v1.0.0 + ``` + +The release workflow will: +- Verify the tag version matches `package.json` version +- Run the full build pipeline (lint, type-check, compile, test) +- Create a VSIX package +- Create a GitHub release with auto-generated release notes +- Attach the VSIX file as a release asset + +**Note**: The workflow will fail if the tag version doesn't match the version in `package.json`. +