Skip to content

Commit f33b1d0

Browse files
committed
chore(doc-ci): improve release documentation ci
Now you no longer need to manually specify the tag version in the pipeline input parameters. In order to launch a pipeline to deploy release documentation into GitHub pages, just select the appropriate tag from the drop-down menu. As before, the version on the site looks like `X.Y.*` (all patches for one minor-major version refer to the same documentation version. The last running pipeline determines the contents of the documentation pages). If you accidentally select not a tag, but a branch from the drop-down menu, then the pipeline will fail with an error with hints.
1 parent ba89ed3 commit f33b1d0

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

.github/workflows/release-documentation.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: release-documentation
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
tag:
7-
description: Git tag to deploy
8-
required: true
9-
type: string
105

116
env:
127
CI_DOCKER_CACHE_PATH: ci/cache/docker
@@ -29,21 +24,31 @@ jobs:
2924
RENDERER_IMAGE: plantuml/plantuml-server:jetty-v1.2026.0
3025
RENDERER_CONTAINER_NAME: renderer
3126
steps:
32-
- name: Validate semver tag format
27+
- name: Check that the pipeline started on a tag and not on a branch
28+
id: validate-inputs
29+
run: |
30+
if [[ "${{ github.ref_type }}" != "tag" ]]; then
31+
echo "::error title=Invalid Ref::Workflow must be triggered on a tag"
32+
echo "::notice::Please select a tag from the dropdown when running this workflow"
33+
exit 1
34+
fi
35+
36+
- name: Check that the tag matches the tag format used by semver
3337
id: validate-tag
3438
run: |
35-
TAG="${{ github.event.inputs.tag }}"
39+
TAG="${{ github.ref_name }}"
3640
3741
if [[ ! $TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
38-
echo "Tag '$TAG' doesn't match semver format"
39-
echo "Examples: 1.2.3, 3.0.1"
42+
echo "::error title=Invalid Semver::Tag '$TAG' doesn't match semver format X.Y.Z"
43+
echo "::notice::Examples of valid tags: 1.2.3, 3.0.1, 0.1.0"
4044
exit 1
4145
fi
4246
4347
MAJOR_MINOR=$(echo $TAG | cut -d. -f1-2)
4448
VERSION="${MAJOR_MINOR}.*"
45-
echo "✅ Valid tag: $TAG"
46-
echo "Version for docs: $VERSION"
49+
50+
echo "::notice title=Valid Version::Deploying documentation for version $VERSION (from tag $TAG)"
51+
echo "tag=$TAG" >> $GITHUB_OUTPUT
4752
echo "version=$VERSION" >> $GITHUB_OUTPUT
4853
4954
- name: Checkout repository with tag

0 commit comments

Comments
 (0)