Skip to content

Commit 059b5c3

Browse files
committed
Create GitHub action to automate mcad release
1 parent 1d7cbee commit 059b5c3

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

.github/workflows/mcad-release.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ jobs:
1414
release:
1515
runs-on: ubuntu-latest
1616

17+
permissions:
18+
contents: write
19+
1720
steps:
1821
- name: checkout code
1922
uses: actions/checkout@v3
2023

21-
- name: Configure Git
22-
run: |
23-
git config user.name "GitHub Actions"
24-
git config user.email "github-actions@github.com"
25-
2624
- name: check tag format
2725
run: |
28-
if [[ "${{ github.event.inputs.tag }}" =~ "^v\d+\.\d+\.\d+$" ]]; then
26+
if [[ "${{ github.event.inputs.tag }}" =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
2927
echo "Tag format is valid."
3028
else
3129
echo "Invalid tag format: ${{ github.event.inputs.tag }}"
@@ -38,5 +36,8 @@ jobs:
3836
echo "Tag ${{ github.event.inputs.tag }} already exist. Exiting workflow."
3937
exit 1
4038
else
41-
gh release create ${{ github.event.inputs.tag }} --title "MCAD ${{ github.event.inputs.tag }} Release" --generate-notes
42-
fi
39+
gh release create ${{ github.event.inputs.tag }} --title "MCAD ${{ github.event.inputs.tag }} Release" --generate-notes --target ${{ github.ref }}
40+
fi
41+
env:
42+
GITHUB_TOKEN: ${{ github.token }}
43+

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ifneq ($(strip $(GIT_BRANCH)),)
2323
RELEASE_VER:=${GIT_BRANCH}
2424
TAG:=release-${TAG}
2525
else
26-
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)
26+
RELEASE_VER:= $(shell git describe --tags --abbrev=0)
2727
TAG:=${TAG}${GIT_BRANCH}
2828
# replace invalid characters that might exist in the branch name
2929
TAG:=$(shell echo ${TAG} | sed 's/[^a-zA-Z0-9]/-/g')

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Refer to [deployment instructions here](./doc/deploy/deployment.md) on how to de
1717

1818
## Release Process
1919

20-
1. Run the [mcad-release.yml](https://github.com/project-codeflare/actions/workflows/mcad-release.yml) action.
20+
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`.
21+
![mcad-release](doc/images/mcad-release.png)
2122

2223
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.
2324

deployment/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CAT_CMD=$(if $(filter $(OS),Windows_NT),type,cat)
77
OPERATOR_VERSION_FILE=./OPERATOR_VERSION
88
OPERATOR_VER=v$(shell $(CAT_CMD) $(OPERATOR_VERSION_FILE))
99
OPERATOR_VER_NUM=$(shell $(CAT_CMD) $(OPERATOR_VERSION_FILE))
10-
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)
10+
CONTROLLER_VER=$(shell git describe --tags --abbrev=0)
1111

1212
check_delete_operator:
1313
@echo "****************************************************************************************************"

doc/images/mcad-release.png

239 KB
Loading

0 commit comments

Comments
 (0)