Skip to content

Commit

Permalink
Update workflow to create a CLI release tag (#1101)
Browse files Browse the repository at this point in the history
* update workflow to create a CLI release tag

Signed-off-by: tvallin <thibault.vallin@oracle.com>
  • Loading branch information
tvallin authored Jan 30, 2025
1 parent afe781e commit f5a75ae
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 8 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Copyright (c) 2025 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Release"

on:
workflow_call:
inputs:
tag:
description: The release tag
required: true
type: string
default: ''

concurrency:
group: release-cli-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
create-cli-tag:
runs-on: ubuntu-20.04
environment: release
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
- uses: ./.github/actions/common
with:
run: |
version=$(echo '${{ inputs.tag }}' | cut -d '/' -f 3)
cli_tag="cli/${version}"
git tag -f "${cli_tag}"
git push --force origin refs/tags/"${cli_tag}":refs/tags/"${cli_tag}"
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,9 @@ jobs:
artifact-name: io-helidon-build-tools-artifacts-${{ github.ref_name }}
artifact-path: target/nexus-staging/
run: etc/scripts/release.sh release_build
release-cli:
if: ${{ startsWith(github.ref_name, 'release-cli') }}
needs: release
uses: ./.github/workflows/release-cli.yml
with:
tag: ${{ needs.create-tag.outputs.tag }}
8 changes: 4 additions & 4 deletions etc/CLI_RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## CLI release checklist
# CLI release checklist

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

# SDKMan
## SDKMan

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

Expand Down Expand Up @@ -50,11 +50,11 @@ curl -X POST \
https://vendors.sdkman.io/announce/struct
```

# HomeBrew
## HomeBrew

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

## Useful links
# Useful links

* SDKMan: https://sdkman.io/vendors
* HomeBrew: https://docs.brew.sh/
8 changes: 4 additions & 4 deletions etc/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ $(basename "${0}") [ --build-number=N ] CMD
Print the release version
create_tag
Create and and push a release tag
Create and push a release tag
release_build
Perform a release build
Expand Down Expand Up @@ -107,7 +107,7 @@ readonly WS_DIR
# this allows us to use fd 6 for returning data
exec 6>&1 1>&2

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

release_version() {
release_version(){
local current_version
current_version=$(current_version)
echo "${current_version%-*}"
Expand All @@ -142,7 +142,7 @@ update_version(){
-DupdateMatchingVersions="false"
}

create_tag() {
create_tag(){
local git_branch version

version=$(release_version)
Expand Down

0 comments on commit f5a75ae

Please sign in to comment.