Skip to content

Commit

Permalink
Create GitHub action to automate mcad release
Browse files Browse the repository at this point in the history
  • Loading branch information
Srihari1192 authored and anishasthana committed Jul 5, 2023
1 parent e87b97c commit 2b7da3a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/mcad-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: checkout code
uses: actions/checkout@v3

- name: Configure Git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: check tag format
run: |
if [[ "${{ github.event.inputs.tag }}" =~ "^v\d+\.\d+\.\d+$" ]]; then
if [[ "${{ github.event.inputs.tag }}" =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "Tag format is valid."
else
echo "Invalid tag format: ${{ github.event.inputs.tag }}"
Expand All @@ -38,5 +36,8 @@ jobs:
echo "Tag ${{ github.event.inputs.tag }} already exist. Exiting workflow."
exit 1
else
gh release create ${{ github.event.inputs.tag }} --title "MCAD ${{ github.event.inputs.tag }} Release" --generate-notes
fi
gh release create ${{ github.event.inputs.tag }} --title "MCAD ${{ github.event.inputs.tag }} Release" --generate-notes --target ${{ github.ref }}
fi
env:
GITHUB_TOKEN: ${{ github.token }}

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ifneq ($(strip $(GIT_BRANCH)),)
RELEASE_VER:=${GIT_BRANCH}
TAG:=release-${TAG}
else
RELEASE_VER:= $(shell curl -s https://pkg.go.dev/github.com/project-codeflare/multi-cluster-app-dispatcher | grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n 1)
RELEASE_VER:= $(shell git describe --tags --abbrev=0)
TAG:=${TAG}${GIT_BRANCH}
# replace invalid characters that might exist in the branch name
TAG:=$(shell echo ${TAG} | sed 's/[^a-zA-Z0-9]/-/g')
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Refer to [deployment instructions here](./doc/deploy/deployment.md) on how to de

## Release Process

1. Run the [mcad-release.yml](https://github.com/project-codeflare/actions/workflows/mcad-release.yml) action.
1. Run the [mcad-release.yml](https://github.com/project-codeflare/actions/workflows/mcad-release.yml) action under `Actions` by entering the new release version in the `Release tag` input field and click `Run workflow`.
![mcad-release](doc/images/mcad-release.png)

2. Verify that [mcad-release.yml](https://github.com/project-codeflare/actions/workflows/mcad-release.yml) action passed successfully. This workflow will create GitHub release tag.

Expand Down
2 changes: 1 addition & 1 deletion deployment/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CAT_CMD=$(if $(filter $(OS),Windows_NT),type,cat)
OPERATOR_VERSION_FILE=./OPERATOR_VERSION
OPERATOR_VER=v$(shell $(CAT_CMD) $(OPERATOR_VERSION_FILE))
OPERATOR_VER_NUM=$(shell $(CAT_CMD) $(OPERATOR_VERSION_FILE))
CONTROLLER_VER=$(shell curl -s https://pkg.go.dev/github.com/project-codeflare/multi-cluster-app-dispatcher | grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n 1)
CONTROLLER_VER=$(shell git describe --tags --abbrev=0)

check_delete_operator:
@echo "****************************************************************************************************"
Expand Down
Binary file added doc/images/mcad-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b7da3a

Please sign in to comment.