Skip to content

Commit

Permalink
move cli tag creation to release workflow + update documentation
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <thibault.vallin@oracle.com>
  • Loading branch information
tvallin committed Jan 28, 2025
1 parent 1e7932d commit 5623df6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 83 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/release-cli.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
- id: create-tag
run: ./etc/scripts/release.sh create_tag >> "${GITHUB_OUTPUT}"
create-cli-tag:
if: ${{ startsWith(github.ref_name, 'release-cli') }}
needs: create-tag
runs-on: ubuntu-20.04
environment: release
outputs:
cli-tag: ${{ steps.create-cli-tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
- uses: ./.github/actions/common
with:
run: |
version=$(echo '${{ needs.create-tag.outputs.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}"
validate:
needs: create-tag
uses: ./.github/workflows/validate.yml
Expand Down
13 changes: 9 additions & 4 deletions etc/CLI_RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## CLI release checklist
# CLI release checklist

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

# SDKMan
## Create CLI release tag

Push a new branch `release-cli-*` to make a usual release and then create a specific cli release tag with this
shape `cli/${version}`.

## SDKMan

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

Expand Down Expand Up @@ -50,11 +55,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/
33 changes: 1 addition & 32 deletions etc/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ $(basename "${0}") [ --build-number=N ] CMD
create_tag
Create and push a release tag
create_cli_tag
Create and push a CLI release tag
release_build
Perform a release build
Expand All @@ -75,7 +72,7 @@ while (( ${#} > 0 )); do
usage
exit 0
;;
"update_version"|"release_version"|"create_tag"|"release_build"|"create_cli_tag")
"update_version"|"release_version"|"create_tag"|"release_build")
COMMAND="${1}"
shift
;;
Expand Down Expand Up @@ -172,34 +169,6 @@ create_tag(){
echo "tag=refs/tags/${version}" >&6
}

create_cli_tag(){
local git_branch version cli_tag

version=$(release_version)
cli_tag="cli/${version}"
git_branch="release/${cli_tag}"

# Use a separate branch
git branch -D "${git_branch}" > /dev/null 2>&1 || true
git checkout -b "${git_branch}"

# Invoke update_version
update_version "${version}"

# Git user info
git config user.email || git config --global user.email "info@helidon.io"
git config user.name || git config --global user.name "Helidon Robot"

# Commit version changes
git commit -a -m "Release ${cli_tag}"

# Create and push a git tag
git tag -f "${cli_tag}"
git push --force origin refs/tags/"${cli_tag}":refs/tags/"${cli_tag}"

echo "tag=refs/tags/${cli_tag}" >&6
}

release_build(){
local tmpfile version

Expand Down

0 comments on commit 5623df6

Please sign in to comment.