Skip to content

Commit 1e1acee

Browse files
committed
Merge branch 'main' into 2.1.x
2 parents 3d51c5c + b1daff7 commit 1e1acee

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

.github/workflows/tagged_release.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,24 @@ jobs:
102102
exit 1
103103
fi
104104
105-
- name: Prepare git branch
106-
run: |
107-
git fetch
108-
git ls-remote --exit-code --heads origin ${{ env.release_branch_name }} >/dev/null 2>&1
109-
EXIT_CODE=$?
110-
if [[ $EXIT_CODE == '0' ]]; then
111-
git checkout ${{ env.release_branch_name }}
112-
git pull
113-
elif [[ $EXIT_CODE == '2' ]]; then
114-
git checkout -b ${{ env.release_branch_name }}
115-
fi
116-
117105
- name: Set versions
118106
continue-on-error: true
119107
run: |
120108
release_version=${{ github.event.inputs.release_version }}
121109
release_branch_name=${release_version%.*}.x
122110
echo "release_branch_name=$release_branch_name" >> $GITHUB_ENV
123111
112+
- name: Prepare release branch
113+
continue-on-error: true
114+
run: |
115+
git fetch
116+
git checkout -b ${{ env.release_branch_name }}
117+
git push --set-upstream origin ${{ env.release_branch_name }}
118+
119+
- uses: actions/checkout@v4
120+
with:
121+
ref: ${{ env.release_branch_name }}
122+
124123
- name: Set antora version
125124
run: yq eval -i '.version = "${{ github.event.inputs.release_version }}"' documentation/python-sdk-guide/antora.yml
126125

@@ -132,18 +131,16 @@ jobs:
132131
echo "EsmfVersion=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV
133132
echo "::set-output name=EsmfVersion::${{ github.event.inputs.release_version }}"
134133
135-
- name: Create a release branch
134+
- name: Push changes to the release branch
136135
run: |
136+
git pull
137137
git add documentation/python-sdk-guide/antora.yml
138138
git add core/esmf-aspect-meta-model-python/pyproject.toml
139139
git commit -m "Release version ${{steps.ESMF_version.outputs.EsmfVersion}}."
140-
git ls-remote --exit-code --heads origin ${{ env.release_branch_name }} >/dev/null 2>&1
141-
EXIT_CODE=$?
142-
if [[ $EXIT_CODE == '0' ]]; then
143-
git push
144-
elif [[ $EXIT_CODE == '2' ]]; then
145-
git push --set-upstream origin ${{ env.release_branch_name }}
146-
fi
140+
git push
141+
142+
- name: Create tag
143+
run: |
147144
tag_version=v${{ github.event.inputs.release_version }}
148145
git tag $tag_version
149146
git push origin $tag_version

0 commit comments

Comments
 (0)