Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ extends:
rules:
# Type enum - allowed commit types
type-enum:
- 2 # Level: error
- 2 # Level: error
- always
- # Allowed types:
- feat # New feature
- fix # Bug fix
- docs # Documentation only changes
- style # Code style changes (formatting, missing semi-colons, etc)
- refactor # Code refactoring (neither fixes a bug nor adds a feature)
- perf # Performance improvements
- test # Adding or updating tests
- build # Changes to build system or dependencies
- ci # CI/CD configuration changes
- chore # Other changes that don't modify src or test files
- revert # Revert a previous commit
- feat # New feature
- fix # Bug fix
- docs # Documentation only changes
- style # Code style changes (formatting, missing semi-colons, etc)
- refactor # Code refactoring (neither fixes a bug nor adds a feature)
- perf # Performance improvements
- test # Adding or updating tests
- build # Changes to build system or dependencies
- ci # CI/CD configuration changes
- chore # Other changes that don't modify src or test files
- revert # Revert a previous commit

# Type case should be lowercase
type-case:
Expand Down Expand Up @@ -62,17 +62,17 @@ rules:

# Body should have a blank line before it
body-leading-blank:
- 1 # Warning level
- 1 # Warning level
- always

# Footer should have a blank line before it
footer-leading-blank:
- 1 # Warning level
- 1 # Warning level
- always

# Body max line length
body-max-line-length:
- 1 # Warning level
- 1 # Warning level
- always
- 100

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/preview-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
needs: generate

steps:
- name: Display changelog preview
run: |
echo "=========================================="
echo "CHANGELOG PREVIEW"
echo "=========================================="
echo ""
echo "${{ needs.generate.outputs.changelog }}"
shell: bash
- name: Display changelog preview
run: |
echo "=========================================="
echo "CHANGELOG PREVIEW"
echo "=========================================="
echo ""
echo "${{ needs.generate.outputs.changelog }}"
shell: bash
57 changes: 37 additions & 20 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This file provides guidance to Claude Code (claude.ai/code) when working with
code in this repository.

## Critical Rules

**These rules override all other instructions:**

1. **NEVER commit directly to main** - Always create a feature branch and submit a pull request
1. **NEVER commit directly to main** - Always create a feature branch and submit
a pull request
2. **Conventional commits** - Format: `type(scope): description`
3. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files. Use conventional commit format for issue titles
3. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO
files. Use conventional commit format for issue titles
4. **Pull Request titles** - Use conventional commit format (same as commits)
5. **Branch naming** - Use format: `type/scope/short-description` (e.g., `feat/action/new-input`)
5. **Branch naming** - Use format: `type/scope/short-description` (e.g.,
`feat/action/new-input`)
6. **Working an issue** - Always create a new branch from an updated main branch
7. **Check branch status before pushing** - Verify the remote tracking branch still exists. If a PR was merged/deleted, create a new branch from main instead
8. **No co-authors** - Do not add co-author information on commits or pull requests
9. **No "generated by" statements** - Do not add generated-by statements on pull requests
7. **Check branch status before pushing** - Verify the remote tracking branch
still exists. If a PR was merged/deleted, create a new branch from main
instead
8. **No co-authors** - Do not add co-author information on commits or pull
requests
9. **No "generated by" statements** - Do not add generated-by statements on pull
requests

---

Expand All @@ -29,22 +37,26 @@ gh issue close <number>

### Conventional Commit Types

| Type | Description |
|------|-------------|
| `feat` | New feature |
| `fix` | Bug fix |
| `docs` | Documentation only |
| Type | Description |
| ---------- | ------------------------------------------------------- |
| `feat` | New feature |
| `fix` | Bug fix |
| `docs` | Documentation only |
| `refactor` | Code change that neither fixes a bug nor adds a feature |
| `test` | Adding or updating tests |
| `chore` | Maintenance tasks |
| `perf` | Performance improvement |
| `ci` | CI/CD changes |
| `test` | Adding or updating tests |
| `chore` | Maintenance tasks |
| `perf` | Performance improvement |
| `ci` | CI/CD changes |

---

## Project Overview

This is a GitHub Action (`CodingWithCalvin/GHA-VSVsixVersioner`) that versions Visual Studio extensions (.vsix) using a date-based versioning scheme: `YYYY.M.D.BuildNumber`. It updates both the XML manifest (`source.extension.vsixmanifest`) and the C# code-behind file (`source.extension.cs`) that are synchronized via VSIX Synchronizer.
This is a GitHub Action (`CodingWithCalvin/GHA-VSVsixVersioner`) that versions
Visual Studio extensions (.vsix) using a date-based versioning scheme:
`YYYY.M.D.BuildNumber`. It updates both the XML manifest
(`source.extension.vsixmanifest`) and the C# code-behind file
(`source.extension.cs`) that are synchronized via VSIX Synchronizer.

**Important**: This action only runs on Windows-based GitHub runners.

Expand Down Expand Up @@ -81,16 +93,21 @@ npm run all

## Architecture

Single-file TypeScript GitHub Action (`src/index.ts`) bundled with `@vercel/ncc` to `dist/index.js`.
Single-file TypeScript GitHub Action (`src/index.ts`) bundled with `@vercel/ncc`
to `dist/index.js`.

**Flow:**

1. Reads `extension-manifest-file` and `extension-source-file` inputs (required)
2. Generates version string: `YYYY.M.D.{build-number}` (build-number defaults to `github.context.runNumber`)
3. Parses XML manifest with `fast-xml-parser`, updates `PackageManifest.Metadata.Identity[@Version]`
2. Generates version string: `YYYY.M.D.{build-number}` (build-number defaults to
`github.context.runNumber`)
3. Parses XML manifest with `fast-xml-parser`, updates
`PackageManifest.Metadata.Identity[@Version]`
4. Updates C# source file by replacing `Version = "x.x.x.x";` pattern via regex
5. Outputs the generated `version` for downstream steps

**Key dependencies:**

- `@actions/core` - GitHub Action I/O and failure handling
- `@actions/github` - GitHub context (run number)
- `fast-xml-parser` - XML parsing/building for vsixmanifest
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,33 @@
[![GitHub release](https://img.shields.io/github/v/release/CodingWithCalvin/GHA-VSVsixVersioner?style=for-the-badge)](https://github.com/CodingWithCalvin/GHA-VSVsixVersioner/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)](LICENSE)

🏷️ Version your Visual Studio extensions automatically based on date and build number!
🏷️ Version your Visual Studio extensions automatically based on date and build
number!

This GitHub Action updates your Visual Studio extension to a version based on the current date and CI build number.
This GitHub Action updates your Visual Studio extension to a version based on
the current date and CI build number.

## 🚀 Usage

You can use the Visual Studio VSIX Versioner GitHub Action by configuring a YAML-based workflow file, e.g. `.github/workflows/deploy.yml`.
You can use the Visual Studio VSIX Versioner GitHub Action by configuring a
YAML-based workflow file, e.g. `.github/workflows/deploy.yml`.

> ⚠️ **Note:** This action requires your extension to utilize the [VSIX Synchronizer](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VsixSynchronizer64) model for managing the version in the `source.extension.vsixmanifest` and the `source.extension.cs` code-behind file that is automatically synchronized.
> ⚠️ **Note:** This action requires your extension to utilize the
> [VSIX Synchronizer](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VsixSynchronizer64)
> model for managing the version in the `source.extension.vsixmanifest` and the
> `source.extension.cs` code-behind file that is automatically synchronized.
>
> Other versioning styles will be supported in the future.

> ⚠️ **Note:** This action only works on a Windows-based runner.

## 📥 Inputs

| Input | Required | Description |
|-------|----------|-------------|
| `extension-manifest-file` | Yes | Path to your `source.extension.vsixmanifest` file |
| `extension-source-file` | Yes | Path to the source file generated from the manifest (using VSIX Synchronizer) |
| `build-number` | No | Build number to use for versioning (defaults to `run_number`) |
| Input | Required | Description |
| ------------------------- | -------- | ----------------------------------------------------------------------------- |
| `extension-manifest-file` | Yes | Path to your `source.extension.vsixmanifest` file |
| `extension-source-file` | Yes | Path to the source file generated from the manifest (using VSIX Synchronizer) |
| `build-number` | No | Build number to use for versioning (defaults to `run_number`) |

## 📋 Example

Expand All @@ -49,7 +55,9 @@ steps:
## 👥 Contributors

<!-- readme: contributors -start -->
[![CalvinAllen](https://avatars.githubusercontent.com/u/41448698?v=4&s=64)](https://github.com/CalvinAllen)

[![CalvinAllen](https://avatars.githubusercontent.com/u/41448698?v=4&s=64)](https://github.com/CalvinAllen)

<!-- readme: contributors -end -->

## 📄 License
Expand Down
Loading