feat(packages): add upload command
Description
Adds glab packages upload (alias ul): uploads a local file to the package
registry as a generic package, identified by --name and --version. The
stored file name defaults to the local file name and can be overridden with
--filename. On success it prints the resulting package URL and SHA256.
Related Issues
Related to #7421 (closed)
How has this been tested?
Automated:
go test ./internal/commands/packages/upload/...golangci-lint run ./internal/commands/packages/...— 0 issues
Manual (against a project you can write to, e.g. -R group/project):
- Build the branch:
make build echo hello > /tmp/app.txt./bin/glab packages upload /tmp/app.txt --name my-package --version 1.0.0 -R group/project— prints the package URL and SHA256../bin/glab packages list -R group/project --name my-package— the uploaded package appears../bin/glab packages upload /tmp/app.txt --name my-package --version 1.0.0 --filename release.txt -R group/project— the file is stored underrelease.txt../bin/glab packages ul /tmp/app.txt -n my-package -v 1.0.1 -R group/project— theulalias and short flags work../bin/glab packages upload /tmp/missing.txt -n my-package -v 1.0.0 -R group/project— fails cleanly with a "unable to read file" error.
Stacked MRs (review/merge bottom-up):
- !3393 (merged) — Add packages command group with list
- !3394 (merged) — Add packages upload command (depends on !3393 (merged))
- !3395 (merged) — Add packages download command (depends on !3394 (merged))
- !3396 (merged) — Add packages delete command (depends on !3395 (merged))
Edited by Oscar Tovar