Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic package multiple assets #20651

Closed
pchampio opened this issue Aug 3, 2022 · 3 comments · Fixed by #20661
Closed

Generic package multiple assets #20651

pchampio opened this issue Aug 3, 2022 · 3 comments · Fixed by #20661
Labels
topic/packages type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@pchampio
Copy link

pchampio commented Aug 3, 2022

Feature Description

Gitea generic package only supports adding a single asset for a given tag version.

_, _, err = packages_service.CreatePackageAndAddFile(
&packages_service.PackageCreationInfo{
PackageInfo: packages_service.PackageInfo{
Owner: ctx.Package.Owner,
PackageType: packages_model.TypeGeneric,
Name: packageName,
Version: packageVersion,
},
SemverCompatible: true,
Creator: ctx.Doer,
},
&packages_service.PackageFileCreationInfo{
PackageFileInfo: packages_service.PackageFileInfo{
Filename: filename,
},
Data: buf,
IsLead: true,
},
)
if err != nil {
if err == packages_model.ErrDuplicatePackageVersion {

I think having the possibility to add multiple assets (for example Windows, MacOS, Linux executable) to a single version is very common.

Ping @KN4CK3R 😉

Screenshots

No response

@pchampio pchampio added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Aug 3, 2022
@KN4CK3R
Copy link
Member

KN4CK3R commented Aug 3, 2022

Sure, may be a bad decission to allow only one file per version. I did it because I don't know how to count the downloads of a version with multiple assests. Should every download of single file increase the version download counter?

@KN4CK3R
Copy link
Member

KN4CK3R commented Aug 3, 2022

Added this in #20661 and increases the download counter for every file.

@pchampio
Copy link
Author

pchampio commented Aug 3, 2022

Should every download of single file increase the version download counter?

yes!

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/packages type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants