Skip to content

Commit 9c666c4

Browse files
ci: deploys bom separately to allow re-do on partial failure (#241)
Before, the bom project deployed only after the parent succeeded. This meant a timeout would prevent it from being deployed, even if the timeout was not critical. This deploys the bom independently so that such a situation doesn't cause us to have to re-cut a version. This also fixes where we didn't actually use the release args in tests. Signed-off-by: Adrian Cole <adrian@tetrate.io>
1 parent 73ac34b commit 9c666c4

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ on:
1414

1515
jobs:
1616
deploy:
17+
name: deploy (${{ matrix.name }})
1718
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
19+
strategy:
20+
fail-fast: false # don't fail fast as we can re-run one job that failed
21+
matrix:
22+
include:
23+
- name: jars
24+
deploy_script: build-bin/deploy
25+
# Deploy the Bill of Materials (BOM) separately as it is unhooked from the main project intentionally
26+
- name: bom
27+
deploy_script: build-bin/deploy_bom
1828
steps:
1929
- name: Checkout Repository
2030
uses: actions/checkout@v4
@@ -51,4 +61,4 @@ jobs:
5161
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
5262
run: | # GITHUB_REF will be refs/heads/master or refs/tags/MAJOR.MINOR.PATCH
5363
build-bin/configure_deploy &&
54-
build-bin/deploy $(echo ${GITHUB_REF} | cut -d/ -f 3)
64+
${{ matrix.deploy_script }} $(echo ${GITHUB_REF} | cut -d/ -f 3)

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ jobs:
6969
# via forks, and login session ends up in ~/.docker. This is ok because
7070
# we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner.
7171
- name: Test
72-
run: build-bin/configure_test && build-bin/test
72+
run: build-bin/configure_test && build-bin/test ${{ matrix.maven_args }}

build-bin/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ This is a Maven project, which uses standard conventions for test and deploy.
55
What's notable is that it has Docker (testcontainers) tests and that it has a Maven BOM.
66
The latter implies deploy runs twice: once for the normal project modules, and again for the BOM.
77

8+
On deploy_bom:
9+
* The artifact `brave-bom` is deployed. Intentionally separate to allow a retry.
10+
811
[//]: # (Below here should be standard for all projects)
912

1013
## Build Overview

build-bin/deploy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@
55
# See [README.md] for an explanation of this and how CI should use it.
66

77
build-bin/maven/maven_deploy -pl -:zipkin-reporter-bom
8-
# Deploy the Bill of Materials (BOM) separately as it is unhooked from the main project intentionally
9-
build-bin/maven/maven_deploy -f bom/pom.xml

build-bin/deploy_bom

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh -ue
2+
3+
# This script deploys a master or release version.
4+
#
5+
# See [README.md] for an explanation of this and how CI should use it.
6+
7+
# Deploy the Bill of Materials (BOM) separately as it is unhooked from the main project intentionally
8+
build-bin/maven/maven_deploy -f bom/pom.xml

0 commit comments

Comments
 (0)