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

View file

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

View file

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

View file

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