You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**MINOR** version for new functionality in a backward-compatible manner
33
33
-**PATCH** version for backward-compatible bug fixes
34
34
35
-
### 2. Update Version in Code (Optional)
35
+
### 2. Create and Push a Git Tag
36
36
37
-
The version in `cmd/react-analyzer/main.go` can be updated to match the release:
37
+
**The git tag is the single source of truth for versioning** - you don't need to manually update version files in the repo.
38
38
39
-
```go
40
-
constVersion = "X.Y.Z"
41
-
```
39
+
How versioning works during releases:
42
40
43
-
This is optional as the version will also be set via ldflags during build.
41
+
**CLI Binary:**
42
+
- Source file `cmd/react-analyzer/main.go` contains `const Version = "dev"` (for development builds)
43
+
- During release builds, GoReleaser uses ldflags to override this with the git tag version
44
+
- Released binaries will show the correct version from the tag when running `react-analyzer --version`
44
45
45
-
### 3. Create and Push a Git Tag
46
+
**VS Code Extension:**
47
+
- Source file `vscode-extension/package.json` contains a placeholder version (manually managed)
48
+
- During release, the `package-extension` job temporarily updates this to match the git tag
49
+
- The packaged `.vsix` file contains the correct version from the tag
50
+
- These version changes are **not committed back** - they're only used for packaging
46
51
47
52
```bash
48
53
# Ensure you're on main and up to date
@@ -56,41 +61,44 @@ git tag -a vX.Y.Z -m "Release vX.Y.Z"
56
61
git push origin vX.Y.Z
57
62
```
58
63
59
-
**Important:** The tag MUST start with `v` (e.g., `v1.0.0`, not `1.0.0`)
64
+
**Important:** The tag MUST start with `v` (e.g., `v0.0.3`, not `0.0.3`)
60
65
61
-
### 4. Automated Build Process
66
+
### 3. Automated Build Process
62
67
63
68
Once the tag is pushed:
64
69
65
70
1.**Test Job**: Tests run once on Ubuntu to verify code quality
66
-
2.**Build Jobs**: Binaries are built on native platforms in parallel (matrix strategy):
71
+
2.**Extension Packaging Job**: Temporarily syncs version from git tag, then compiles and packages VS Code extension into `.vsix` file
72
+
3.**Build Jobs**: CLI binaries are built on native platforms in parallel (matrix strategy):
67
73
-**macOS builds** run on `macos-latest` (for darwin/amd64 and darwin/arm64)
68
74
-**Linux builds** run on `ubuntu-latest` (for linux/amd64 and linux/arm64)
69
75
-**Windows build** runs on `windows-latest` (for windows/amd64)
70
76
- Each job uses `goreleaser build --single-target` for native compilation with CGO
71
-
3.**Release Job**: After all builds complete:
72
-
- Downloads all build artifacts
77
+
4.**Release Job**: After all builds complete:
78
+
- Downloads all build artifacts (CLI binaries + extension)
73
79
- Creates archives (`.tar.gz` for Unix, `.zip` for Windows)
74
80
- Generates SHA256 checksums
75
81
- Creates GitHub Release with:
76
82
- Release notes (auto-generated from commits)
77
83
- All platform binaries attached
78
-
- Installation instructions
84
+
- VS Code extension `.vsix` file
85
+
- Installation instructions for both CLI and extension
79
86
80
87
**Note on GoReleaser:** While GoReleaser is used for building (`goreleaser build`), the final packaging is done manually in GitHub Actions. This is the standard pattern for CGO projects without GoReleaser Pro. The `.goreleaser.yml` file is primarily for local development testing.
81
88
82
-
### 5. Verify the Release
89
+
### 4. Verify the Release
83
90
84
91
1. Go to https://github.com/rautio/react-analyzer/releases
85
-
2. Find your new release (e.g., `v1.0.0`)
86
-
3. Check that all expected binaries are attached:
92
+
2. Find your new release (e.g., `v0.0.3`)
93
+
3. Check that all expected artifacts are attached:
0 commit comments