Skip to content

Commit cf1b7bf

Browse files
author
Caleb Lloyd
committed
apply patch to stable release
Signed-off-by: Caleb Lloyd <[email protected]>
1 parent c3771a4 commit cf1b7bf

File tree

4 files changed

+37
-14
lines changed

4 files changed

+37
-14
lines changed

.github/workflows/deps-release-detect.yaml

+8-5
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,19 @@ jobs:
6666
echo "prevVersion : $prevVersion"
6767
echo "newVersion : $newVersion"
6868
69-
tag_deps_version="$(git ls-remote 2>/dev/null \
69+
tagPrevVersion="$(git ls-remote 2>/dev/null \
7070
| grep -oE 'refs/tags/v[0-9]+\.[0-9]+\.[0-9]+' \
7171
| cut -d'/' -f3 \
7272
| xargs semver \
73-
| tail -n 1 \
74-
| xargs semver -i patch)"
73+
| tail -n 1)"
74+
75+
tagNewVersion="$(semver -i patch "$tagPrevVersion")"
7576
76-
echo "$tag_deps_version" > ./cicd/tag-base-version.txt
77+
echo "$tagPrevVersion" > ./cicd/tag-deps-version.txt
78+
echo "$tagNewVersion" >> ./cicd/tag-deps-version.txt
79+
7780
git add ./cicd/tag-base-version.txt
78-
if git commit -m "bump dependency release to $tag_deps_version"; then
81+
if git commit -m "bump dependency release to $tagNewVersion"; then
7982
push=1
8083
fi
8184
done

.github/workflows/deps-release-tag.yaml

+27-8
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,43 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Configure Git
22+
run: |
23+
git config user.name "$GITHUB_ACTOR"
24+
git config user.email "[email protected]"
1825
1926
- id: tag
2027
name: Determine tag
2128
run: |
22-
version="$(head -n 1 ./cicd/tag_deps_version.txt)"
23-
ref_name="v$version"
29+
old_version="$(head -n 1 ./cicd/tag-deps-version.txt)"
30+
old_ref_name="v$old_version"
31+
new_version="$(tail -n 1 ./cicd/tag-deps-version.txt)"
32+
new_ref_name="v$new_version"
33+
2434
create=true
25-
if [ "$(git ls-remote origin "refs/tags/$ref_name" | wc -l)" = "1" ]; then
35+
if [ "$(git ls-remote origin "refs/tags/$new_ref_name" | wc -l)" = "1" ]; then
2636
create=false
2737
fi
2838
29-
echo "version=$version" | tee -a "$GITHUB_OUTPUT"
30-
echo "ref-name=$ref_name" | tee -a "$GITHUB_OUTPUT"
39+
echo "old-version=$old_version" | tee -a "$GITHUB_OUTPUT"
40+
echo "old-ref-name=$old_ref_name" | tee -a "$GITHUB_OUTPUT"
41+
echo "new-version=$new_version" | tee -a "$GITHUB_OUTPUT"
42+
echo "new-ref-name=$new_ref_name" | tee -a "$GITHUB_OUTPUT"
3143
echo "create=$create" | tee -a "$GITHUB_OUTPUT"
3244
3345
- if: ${{ fromJSON(steps.tag.outputs.create) }}
3446
name: Tag
3547
run: |
36-
git tag "${{ steps.tag.outputs.ref-name }}"
37-
git push origin "${{ steps.tag.outputs.ref-name }}"
48+
commit="$(git rev-parse HEAD)"
49+
git fetch origin refs/tags/"${{ steps.tag.outputs.old-ref-name }}"
50+
git checkout -b deps "${{ steps.tag.outputs.old-ref-name }}"
51+
git restore --source="$commit" ./cicd
52+
git add ./cicd
53+
if git commit -m "bump dependency release to ${{ steps.tag.outputs.new-version }}"; then
54+
git tag "${{ steps.tag.outputs.new-ref-name }}"
55+
git push origin "${{ steps.tag.outputs.new-ref-name }}"
56+
fi

cicd/tag-deps-version.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
0.14.0
2+
0.14.1

cicd/tag_deps_version.txt

-1
This file was deleted.

0 commit comments

Comments
 (0)