Some checks are pending
Build and Release / Lint and Test (push) Waiting to run
Build and Release / Build Binaries (amd64, darwin) (push) Blocked by required conditions
Build and Release / Build Binaries (amd64, linux) (push) Blocked by required conditions
Build and Release / Build Binaries (amd64, windows) (push) Blocked by required conditions
Build and Release / Build Binaries (arm64, darwin) (push) Blocked by required conditions
Build and Release / Build Binaries (arm64, linux) (push) Blocked by required conditions
- Add runner capability discovery API (v2) for AI tools to query before writing workflows - Add release archive feature with filter toggle UI - Add GitHub Actions compatibility layer with action aliasing - Store runner capabilities JSON from act_runner Declare calls - Add migrations for release archive and runner capabilities fields 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package convert
|
|
|
|
import (
|
|
"context"
|
|
|
|
repo_model "code.gitea.io/gitea/models/repo"
|
|
api "code.gitea.io/gitea/modules/structs"
|
|
)
|
|
|
|
// ToAPIRelease convert a repo_model.Release to api.Release
|
|
func ToAPIRelease(ctx context.Context, repo *repo_model.Repository, r *repo_model.Release) *api.Release {
|
|
rel := &api.Release{
|
|
ID: r.ID,
|
|
TagName: r.TagName,
|
|
Target: r.Target,
|
|
Title: r.Title,
|
|
Note: r.Note,
|
|
URL: r.APIURL(),
|
|
HTMLURL: r.HTMLURL(),
|
|
TarURL: r.TarURL(),
|
|
ZipURL: r.ZipURL(),
|
|
UploadURL: r.APIUploadURL(),
|
|
IsDraft: r.IsDraft,
|
|
IsPrerelease: r.IsPrerelease,
|
|
CreatedAt: r.CreatedUnix.AsTime(),
|
|
PublishedAt: r.CreatedUnix.AsTime(),
|
|
Publisher: ToUser(ctx, r.Publisher, nil),
|
|
Attachments: ToAPIAttachments(repo, r.Attachments),
|
|
IsArchived: r.IsArchived,
|
|
}
|
|
if r.IsArchived && r.ArchivedUnix > 0 {
|
|
archivedAt := r.ArchivedUnix.AsTime()
|
|
rel.ArchivedAt = &archivedAt
|
|
}
|
|
return rel
|
|
}
|