Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
56624cf
feat(version): add failing tests for version system (TDD Red)
Anthony-Bible Dec 7, 2025
a85c7fc
feat(version): implement version system (TDD Green)
Anthony-Bible Dec 7, 2025
79fd8f6
refactor(version): improve version implementation (TDD Refactor)
Anthony-Bible Dec 7, 2025
06941b9
test(cmd): clean up version tests after refactor
Anthony-Bible Dec 7, 2025
2ba4904
feat(build): add install targets to Makefile
Anthony-Bible Dec 7, 2025
7ca59ef
ci(release): update GitHub Actions and fix version injection
Anthony-Bible Dec 7, 2025
3329203
fix(build): correct ldflags path for version injection
Anthony-Bible Dec 7, 2025
062106a
test(scripts): add failing tests for build automation (TDD Red)
Anthony-Bible Dec 7, 2025
b27299e
feat(scripts): implement build and release automation (TDD Green)
Anthony-Bible Dec 8, 2025
304da09
refactor(scripts): improve build automation robustness (TDD Refactor)
Anthony-Bible Dec 8, 2025
e3ff049
docs: update documentation for Issue 29 - Binary Creation Functionality
Anthony-Bible Dec 8, 2025
8ac0c74
chore(release): bump VERSION to v1.4.0
Anthony-Bible Dec 8, 2025
520dbe9
Remove squash guide
Anthony-Bible Dec 8, 2025
e2e9455
fix(version,cli,build): handle --version early, unify ldflags, and ha…
Anthony-Bible Dec 8, 2025
da18f63
fix(cli): address PR review comments for version handling
Anthony-Bible Dec 8, 2025
6737678
refactor(cmd): simplify version handling; remove sentinel error
Anthony-Bible Dec 15, 2025
dd18cbe
Update Makefile
Anthony-Bible Dec 15, 2025
49319a8
Update README.md
Anthony-Bible Dec 15, 2025
f0f0f6a
Update scripts/release.sh
Anthony-Bible Dec 15, 2025
923288a
Update scripts/release.sh
Anthony-Bible Dec 15, 2025
c13173a
Update INSTALL.md
Anthony-Bible Dec 15, 2025
a1bc3dd
Update internal/version/version.go
Anthony-Bible Dec 15, 2025
08fedb7
Update README.md
Anthony-Bible Dec 15, 2025
2cdab03
Update scripts/build.sh
Anthony-Bible Dec 15, 2025
70b57cf
Initial plan
Copilot Dec 15, 2025
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
140 changes: 102 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,8 @@ permissions:
packages: write

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

build-and-upload:
name: Build and Upload Assets
needs: release
build:
name: Build Release Assets
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -50,17 +29,23 @@ jobs:
arch: arm64
- os: windows
arch: amd64

steps:
- name: Checkout code
uses: actions/checkout@v4

with:
fetch-depth: 0 # Get full history for proper version info

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Build binary

- name: Get build time
id: build_time
run: echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT

- name: Build main binary
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
Expand All @@ -69,22 +54,89 @@ jobs:
if [ "${{ matrix.os }}" = "windows" ]; then
binary_name="${binary_name}.exe"
fi
CGO_ENABLED=1 go build -ldflags="-s -w -X main.Version=${{ github.ref_name }}" -o "$binary_name" main.go

# Build with version, commit, and build time ldflags
CGO_ENABLED=1 go build -ldflags="-s -w \
-X codechunking/cmd.Version=${{ github.ref_name }} \
-X codechunking/cmd.Commit=${{ github.sha }} \
-X codechunking/cmd.BuildTime=${{ steps.build_time.outputs.build_time }}" \
-o "$binary_name" main.go

# Create tarball
tar czf "${binary_name}.tar.gz" "$binary_name"

- name: Upload Release Asset
uses: actions/upload-release-asset@v1

- name: Build client binary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
client_binary="codechunking-client-${{ matrix.os }}-${{ matrix.arch }}"
if [ "${{ matrix.os }}" = "windows" ]; then
client_binary="${client_binary}.exe"
fi

# Build client binary (static, no CGO)
CGO_ENABLED=0 go build -ldflags="-s -w" \
-o "$client_binary" ./cmd/client

# Create tarball
tar czf "${client_binary}.tar.gz" "$client_binary"

- name: Generate checksums
run: |
# Create checksums file
echo "# Checksums for ${{ github.ref_name }}" > checksums.txt

# Add checksums for all artifacts
for file in *.tar.gz; do
if [ -f "$file" ]; then
sha256sum "$file" >> checksums.txt
fi
done

# Display checksums for verification
cat checksums.txt

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-assets-${{ matrix.os }}-${{ matrix.arch }}
path: |
*.tar.gz
checksums.txt
retention-days: 1

create-release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./codechunking-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_name: codechunking-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip
path: artifacts
merge-multiple: true

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
draft: false
prerelease: false
files: |
artifacts/*.tar.gz
artifacts/checksums.txt
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker-release:
name: Docker Release
needs: release
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down Expand Up @@ -118,6 +170,10 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Get build time
id: docker_build_time
run: echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -126,6 +182,14 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.version=${{ github.ref_name }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.docker_build_time.outputs.build_time }}
build-args: |
VERSION=${{ github.ref_name }}
COMMIT=${{ github.sha }}
BUILD_TIME=${{ steps.docker_build_time.outputs.build_time }}
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ tokens.txt

# Temporary test scripts
scripts/*.go
scripts/*.sh

# Local analysis files
countTokens.py
Loading