Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 663a52eded | |||
| b093af7905 | |||
| 02070eddb5 | |||
| 372fd8fdc5 | |||
| 40c7487409 | |||
| 9580480f90 | |||
| 07088bedbc |
28
.gitea/workflows/ci.yml
Normal file
28
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.21'
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build ./...
|
||||||
|
env:
|
||||||
|
GOPRIVATE: git.marketally.com
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test ./...
|
||||||
|
env:
|
||||||
|
GOPRIVATE: git.marketally.com
|
||||||
29
.gitea/workflows/release.yml
Normal file
29
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.21'
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build ./...
|
||||||
|
env:
|
||||||
|
GOPRIVATE: git.marketally.com
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
generate_release_notes: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
80
README.md
80
README.md
@@ -1,2 +1,80 @@
|
|||||||
# proto-go
|
# GitCaddy Actions Proto
|
||||||
|
|
||||||
|
Protocol buffer definitions for communication between Gitea Actions runners and the Gitea server.
|
||||||
|
|
||||||
|
> **This is a GitCaddy fork** of [code.gitea.io/actions-proto-go](https://gitea.com/gitea/actions-proto-go) with enhanced capability reporting support.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
This package provides the protobuf-generated Go code for the Gitea Actions runner protocol. It defines the RPC services and message types used for:
|
||||||
|
|
||||||
|
- Runner registration and declaration
|
||||||
|
- Task fetching and execution
|
||||||
|
- Log streaming and status updates
|
||||||
|
- **Runner capability reporting** (GitCaddy enhancement)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go get git.marketally.com/gitcaddy/actions-proto-go
|
||||||
|
```
|
||||||
|
|
||||||
|
## GitCaddy Enhancements
|
||||||
|
|
||||||
|
### Runner Capability Reporting
|
||||||
|
|
||||||
|
This fork adds the `CapabilitiesJson` field to the `DeclareRequest` message, enabling runners to report their capabilities to the Gitea server:
|
||||||
|
|
||||||
|
```protobuf
|
||||||
|
message DeclareRequest {
|
||||||
|
string version = 1;
|
||||||
|
repeated string labels = 2;
|
||||||
|
string capabilities_json = 3; // NEW: JSON-encoded runner capabilities
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The capabilities JSON includes:
|
||||||
|
- **OS and Architecture**: Runtime environment details
|
||||||
|
- **Docker Support**: Whether Docker/Podman is available
|
||||||
|
- **Shell Support**: Available shells (bash, sh, powershell, etc.)
|
||||||
|
- **Tool Versions**: Installed tools like Node.js, Go, Python, etc.
|
||||||
|
- **Feature Flags**: Cache support, artifact handling, etc.
|
||||||
|
- **Limitations**: Known constraints for AI workflow generation
|
||||||
|
|
||||||
|
### Why This Matters
|
||||||
|
|
||||||
|
AI tools generating CI/CD workflows can query the Gitea API to discover runner capabilities *before* writing workflows, reducing trial-and-error iterations.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```go
|
||||||
|
import (
|
||||||
|
runnerv1 "git.marketally.com/gitcaddy/actions-proto-go/runner/v1"
|
||||||
|
"git.marketally.com/gitcaddy/actions-proto-go/runner/v1/runnerv1connect"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Create a client
|
||||||
|
client := runnerv1connect.NewRunnerServiceClient(httpClient, serverURL)
|
||||||
|
|
||||||
|
// Declare runner with capabilities
|
||||||
|
resp, err := client.Declare(ctx, connect.NewRequest(&runnerv1.DeclareRequest{
|
||||||
|
Version: "0.3.1",
|
||||||
|
Labels: []string{"ubuntu-latest", "docker"},
|
||||||
|
CapabilitiesJson: `{"os":"linux","arch":"amd64","docker":true}`,
|
||||||
|
}))
|
||||||
|
```
|
||||||
|
|
||||||
|
## Related Projects
|
||||||
|
|
||||||
|
| Project | Description |
|
||||||
|
|---------|-------------|
|
||||||
|
| [gitcaddy/gitea](https://git.marketally.com/gitcaddy/gitea) | GitCaddy Gitea fork with AI-friendly enhancements |
|
||||||
|
| [gitcaddy/act_runner](https://git.marketally.com/gitcaddy/act_runner) | Runner with capability detection |
|
||||||
|
|
||||||
|
## Upstream
|
||||||
|
|
||||||
|
This project is a fork of [code.gitea.io/actions-proto-go](https://gitea.com/gitea/actions-proto-go). We aim to contribute enhancements back to upstream where appropriate.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT License - see [LICENSE](LICENSE) for details.
|
||||||
|
|||||||
@@ -282,8 +282,9 @@ type DeclareRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||||
Labels []string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"`
|
Labels []string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"`
|
||||||
|
CapabilitiesJson string `protobuf:"bytes,3,opt,name=capabilities_json,json=capabilitiesJson,proto3" json:"capabilities_json,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeclareRequest) Reset() {
|
func (x *DeclareRequest) Reset() {
|
||||||
@@ -332,6 +333,13 @@ func (x *DeclareRequest) GetLabels() []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DeclareRequest) GetCapabilitiesJson() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.CapabilitiesJson
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type DeclareResponse struct {
|
type DeclareResponse struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
|
|||||||
Reference in New Issue
Block a user