Skip to content

Commit f5a75ae

Browse files
authored
Update workflow to create a CLI release tag (#1101)
* update workflow to create a CLI release tag Signed-off-by: tvallin <[email protected]>
1 parent afe781e commit f5a75ae

File tree

4 files changed

+59
-8
lines changed

4 files changed

+59
-8
lines changed

.github/workflows/release-cli.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Copyright (c) 2025 Oracle and/or its affiliates.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: "Release"
17+
18+
on:
19+
workflow_call:
20+
inputs:
21+
tag:
22+
description: The release tag
23+
required: true
24+
type: string
25+
default: ''
26+
27+
concurrency:
28+
group: release-cli-${{ github.workflow }}-${{ github.ref }}
29+
cancel-in-progress: true
30+
31+
jobs:
32+
create-cli-tag:
33+
runs-on: ubuntu-20.04
34+
environment: release
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
39+
- uses: ./.github/actions/common
40+
with:
41+
run: |
42+
version=$(echo '${{ inputs.tag }}' | cut -d '/' -f 3)
43+
cli_tag="cli/${version}"
44+
git tag -f "${cli_tag}"
45+
git push --force origin refs/tags/"${cli_tag}":refs/tags/"${cli_tag}"

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,9 @@ jobs:
7474
artifact-name: io-helidon-build-tools-artifacts-${{ github.ref_name }}
7575
artifact-path: target/nexus-staging/
7676
run: etc/scripts/release.sh release_build
77+
release-cli:
78+
if: ${{ startsWith(github.ref_name, 'release-cli') }}
79+
needs: release
80+
uses: ./.github/workflows/release-cli.yml
81+
with:
82+
tag: ${{ needs.create-tag.outputs.tag }}

etc/CLI_RELEASE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## CLI release checklist
1+
# CLI release checklist
22

33
This documentation aims to describe the steps to release the Helidon CLI.
44

5-
# SDKMan
5+
## SDKMan
66

77
Helidon team possesses credentials to access `SDKMan` REST API to do the following actions:
88

@@ -50,11 +50,11 @@ curl -X POST \
5050
https://vendors.sdkman.io/announce/struct
5151
```
5252

53-
# HomeBrew
53+
## HomeBrew
5454

5555
Update the `HomeBrew` formula from `homebrew/homebrew-core` to release a new Helidon CLI version.
5656

57-
## Useful links
57+
# Useful links
5858

5959
* SDKMan: https://sdkman.io/vendors
6060
* HomeBrew: https://docs.brew.sh/

etc/scripts/release.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ $(basename "${0}") [ --build-number=N ] CMD
5252
Print the release version
5353
5454
create_tag
55-
Create and and push a release tag
55+
Create and push a release tag
5656
5757
release_build
5858
Perform a release build
@@ -107,7 +107,7 @@ readonly WS_DIR
107107
# this allows us to use fd 6 for returning data
108108
exec 6>&1 1>&2
109109

110-
current_version() {
110+
current_version(){
111111
# shellcheck disable=SC2086
112112
mvn ${MVN_ARGS} -q \
113113
-f "${WS_DIR}"/pom.xml \
@@ -117,7 +117,7 @@ current_version() {
117117
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec
118118
}
119119

120-
release_version() {
120+
release_version(){
121121
local current_version
122122
current_version=$(current_version)
123123
echo "${current_version%-*}"
@@ -142,7 +142,7 @@ update_version(){
142142
-DupdateMatchingVersions="false"
143143
}
144144

145-
create_tag() {
145+
create_tag(){
146146
local git_branch version
147147

148148
version=$(release_version)

0 commit comments

Comments
 (0)