release: Fix the Deb archives

Fixes #10220
This commit is contained in:
Bjørn Erik Pedersen 2022-08-29 11:47:37 +02:00
parent 9eb9b70a29
commit 79932e7225
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
4 changed files with 12 additions and 7 deletions

View file

@ -4,7 +4,7 @@ parameters:
defaults: &defaults
resource_class: large
docker:
- image: bepsays/ci-hugoreleaser:1.21900.20000
- image: bepsays/ci-hugoreleaser:1.21900.20001
environment: &buildenv
GOMODCACHE: /root/project/gomodcache
version: 2
@ -60,7 +60,7 @@ jobs:
environment:
<<: [*buildenv]
docker:
- image: bepsays/ci-hugoreleaser-linux-arm64:1.21900.20000
- image: bepsays/ci-hugoreleaser-linux-arm64:1.21900.20001
steps:
- *restore-cache
- &attach-workspace

View file

@ -1,5 +1,3 @@
HUGO_RELEASE_NAME=New release setup
# Release env.
# These will be replaced by script before release.
HUGORELEASER_TAG=v0.102.0

View file

@ -33,7 +33,7 @@ project = "hugo"
dragonfly = "DragonFlyBSD"
[release_settings]
name = "${HUGO_RELEASE_NAME}"
name = "${HUGORELEASER_TAG}"
type = "github"
repository = "hugo"
repository_owner = "gohugoio"
@ -190,6 +190,8 @@ project = "hugo"
[[archives]]
paths = ["builds/**/regular/linux/{arm64,amd64}"]
[archives.archive_settings]
binary_dir = "/usr/local/bin"
extra_files = []
[archives.archive_settings.type]
format = "_plugin"
extension = ".deb"
@ -206,6 +208,8 @@ project = "hugo"
[[archives]]
paths = ["builds/**/extended/linux/{arm64,amd64}"]
[archives.archive_settings]
binary_dir = "/usr/local/bin"
extra_files = []
name_template = "{{ .Project }}_extended_{{ .Tag | trimPrefix `v` }}_{{ .Goos }}-{{ .Goarch }}"
[archives.archive_settings.type]
format = "_plugin"

View file

@ -40,14 +40,17 @@ func New(skipPush, try bool, step int) (*ReleaseHandler, error) {
if err != nil {
return nil, err
}
branch = strings.TrimSpace(branch)
if !strings.HasPrefix(branch, prefix) {
return nil, fmt.Errorf("branch %q is not a release branch", branch)
}
logf("Branch: %s\n", branch)
version := strings.TrimPrefix(branch, prefix)
version = strings.TrimPrefix(version, "v")
logf("Branch: %s|Version: v%s\n", branch, version)
rh := &ReleaseHandler{branchVersion: version, skipPush: skipPush, try: try, step: step}
if try {