2022-08-05 10:35:24 -04:00
|
|
|
parameters:
|
|
|
|
|
|
|
|
# v2: 11m.
|
2017-09-10 11:14:02 -04:00
|
|
|
defaults: &defaults
|
2022-08-05 10:35:24 -04:00
|
|
|
resource_class: large
|
2017-09-10 11:14:02 -04:00
|
|
|
docker:
|
2024-03-14 15:25:16 -04:00
|
|
|
- image: bepsays/ci-hugoreleaser:1.22200.20100
|
2022-08-05 10:35:24 -04:00
|
|
|
environment: &buildenv
|
|
|
|
GOMODCACHE: /root/project/gomodcache
|
2017-09-10 11:14:02 -04:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2022-08-05 10:35:24 -04:00
|
|
|
prepare_release:
|
|
|
|
<<: *defaults
|
|
|
|
environment: &buildenv
|
|
|
|
GOMODCACHE: /root/project/gomodcache
|
2017-09-10 11:14:02 -04:00
|
|
|
steps:
|
2022-08-05 10:35:24 -04:00
|
|
|
- &remote-docker
|
|
|
|
setup_remote_docker:
|
|
|
|
version: 20.10.14
|
|
|
|
- checkout:
|
2017-09-10 11:14:02 -04:00
|
|
|
path: hugo
|
2022-08-05 10:35:24 -04:00
|
|
|
- &git-config
|
|
|
|
run:
|
|
|
|
command: |
|
|
|
|
git config --global user.email "bjorn.erik.pedersen+hugoreleaser@gmail.com"
|
|
|
|
git config --global user.name "hugoreleaser"
|
2017-09-10 11:14:02 -04:00
|
|
|
- run:
|
2022-08-05 10:35:24 -04:00
|
|
|
command: |
|
|
|
|
cd hugo
|
|
|
|
go mod download
|
|
|
|
go run -tags release main.go release --step 1
|
|
|
|
- save_cache:
|
|
|
|
key: git-sha-{{ .Revision }}
|
|
|
|
paths:
|
|
|
|
- hugo
|
|
|
|
- gomodcache
|
|
|
|
build_container1:
|
|
|
|
<<: [*defaults]
|
|
|
|
environment:
|
|
|
|
<<: [*buildenv]
|
2017-09-10 11:14:02 -04:00
|
|
|
steps:
|
2022-08-05 10:35:24 -04:00
|
|
|
- &restore-cache
|
|
|
|
restore_cache:
|
|
|
|
key: git-sha-{{ .Revision }}
|
2017-09-10 11:14:02 -04:00
|
|
|
- run:
|
2022-08-05 10:35:24 -04:00
|
|
|
no_output_timeout: 20m
|
|
|
|
command: |
|
|
|
|
mkdir -p /tmp/files/dist1
|
|
|
|
cd hugo
|
|
|
|
hugoreleaser build -paths "builds/container1/**" -workers 3 -dist /tmp/files/dist1 -chunks $CIRCLE_NODE_TOTAL -chunk-index $CIRCLE_NODE_INDEX
|
|
|
|
- &persist-workspace
|
|
|
|
persist_to_workspace:
|
|
|
|
root: /tmp/files
|
|
|
|
paths:
|
|
|
|
- dist1
|
|
|
|
- dist2
|
|
|
|
parallelism: 7
|
|
|
|
build_container2:
|
|
|
|
<<: [*defaults]
|
|
|
|
environment:
|
|
|
|
<<: [*buildenv]
|
|
|
|
docker:
|
2024-03-14 15:25:16 -04:00
|
|
|
- image: bepsays/ci-hugoreleaser-linux-arm64:1.22200.20100
|
2022-08-05 10:35:24 -04:00
|
|
|
steps:
|
|
|
|
- *restore-cache
|
|
|
|
- &attach-workspace
|
|
|
|
attach_workspace:
|
|
|
|
at: /tmp/workspace
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
mkdir -p /tmp/files/dist2
|
|
|
|
cd hugo
|
|
|
|
hugoreleaser build -paths "builds/container2/**" -workers 1 -dist /tmp/files/dist2
|
|
|
|
- *persist-workspace
|
|
|
|
archive_and_release:
|
|
|
|
<<: [*defaults]
|
|
|
|
environment:
|
|
|
|
<<: [*buildenv]
|
|
|
|
steps:
|
|
|
|
- *restore-cache
|
|
|
|
- *attach-workspace
|
|
|
|
- *git-config
|
2023-05-23 04:12:16 -04:00
|
|
|
- run:
|
|
|
|
name: Add github.com to known hosts
|
|
|
|
command: ssh-keyscan github.com >> ~/.ssh/known_hosts
|
2022-08-05 10:35:24 -04:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
cp -a /tmp/workspace/dist1/. ./hugo/dist
|
|
|
|
cp -a /tmp/workspace/dist2/. ./hugo/dist
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
cd hugo
|
|
|
|
hugoreleaser archive
|
|
|
|
hugoreleaser release
|
|
|
|
go run -tags release main.go release --step 2
|
2017-09-10 11:14:02 -04:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
release:
|
|
|
|
jobs:
|
2022-08-05 10:35:24 -04:00
|
|
|
- prepare_release:
|
2017-09-10 11:14:02 -04:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: /release-.*/
|
2022-08-05 10:35:24 -04:00
|
|
|
- build_container1:
|
|
|
|
requires:
|
|
|
|
- prepare_release
|
|
|
|
- build_container2:
|
2017-09-10 11:14:02 -04:00
|
|
|
requires:
|
2022-08-05 10:35:24 -04:00
|
|
|
- prepare_release
|
|
|
|
- archive_and_release:
|
2017-09-10 11:14:02 -04:00
|
|
|
context: org-global
|
|
|
|
requires:
|
2022-08-05 10:35:24 -04:00
|
|
|
- build_container1
|
|
|
|
- build_container2
|
|
|
|
|
|
|
|
|
|
|
|
|