Skip to content

Add Makefile for local builds and GitHub Releases to workflow #109

@tig

Description

@tig

Summary

AOT publish is configured and works in CI, but there's no local convenience for building native binaries. The release workflow builds artifacts but doesn't create GitHub Releases with downloadable binaries.

What to do

1. Create Makefile at repo root

Convenience Makefile for local builds and AOT publishing. Auto-detects RID from uname.

Target What it does
make restore dotnet restore
make build Debug build (depends on restore)
make build-release Release build
make test Runs all three test projects (unit, integration, smoke)
make publish AOT publish for current platform to publish/<rid>/. Accepts RID=linux-x64 override
make publish-all AOT publish for osx-arm64, linux-x64, win-x64
make clean rm -rf publish/ + dotnet clean

Publish command: dotnet publish src/Clet -c Release -r $(RID) --self-contained -p:PublishAot=true -o publish/$(RID)

2. Add release job to .github/workflows/release.yml

Insert a new job after tag and before publish-nuget. Also add release to the notify-failure job's needs array.

  • needs: [resolve-version, build, tag]
  • runs-on: ubuntu-latest
  • Steps:
    1. Download all artifacts via actions/download-artifact@v4 to artifacts/
    2. Create archives in dist/:
      • macOS/Linux: tar -czf dist/clet-<version>-<rid>.tar.gz (after chmod +x clet)
      • Windows: zip -r dist/clet-<version>-win-x64.zip
      • Skip missing artifacts with a warning
    3. Create GitHub Release via gh release create v<version>:
      • --title "clet v<version>"
      • --generate-notes
      • --prerelease if version contains - (alpha, develop)
      • Attach all files from dist/*
      • Uses GITHUB_TOKEN and github.repository env vars

3. Update CLAUDE.md Build and Test section

  • Add dotnet run --project tests/Clet.SmokeTests --no-build to the test commands
  • Add a section documenting the Makefile targets

Verification

make publish
./publish/osx-arm64/clet --version
./publish/osx-arm64/clet list
./publish/osx-arm64/clet help --cat

Notes

  • A local commit implementing this exists on feature/makefile-releases (38ea5db) but couldn't be pushed due to SSH agent being unavailable remotely. The branch can be pushed manually or the work can be redone from this spec.
  • Don't modify existing workflow jobs (build, tag, publish-nuget, etc.) — only add the new release job and update notify-failure's needs array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions