Skip to content

Commit

Permalink
apply patch to stable release
Browse files Browse the repository at this point in the history
Signed-off-by: Caleb Lloyd <[email protected]>
  • Loading branch information
Caleb Lloyd committed Apr 9, 2024
1 parent c3771a4 commit d95161f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/deps-release-detect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,19 @@ jobs:
echo "prevVersion : $prevVersion"
echo "newVersion : $newVersion"
tag_deps_version="$(git ls-remote 2>/dev/null \
tagPrevVersion="$(git ls-remote 2>/dev/null \
| grep -oE 'refs/tags/v[0-9]+\.[0-9]+\.[0-9]+' \
| cut -d'/' -f3 \
| xargs semver \
| tail -n 1 \
| xargs semver -i patch)"
| tail -n 1)"
tagNewVersion="$(semver -i patch "$tagPrevVersion")"
echo "$tag_deps_version" > ./cicd/tag-base-version.txt
echo "$tagPrevVersion" > ./cicd/tag-deps-version.txt
echo "$tagNewVersion" >> ./cicd/tag-deps-version.txt
git add ./cicd/tag-base-version.txt
if git commit -m "bump dependency release to $tag_deps_version"; then
if git commit -m "bump dependency release to $tagNewVersion"; then
push=1
fi
done
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/deps-release-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,44 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git checkout -b "$GITHUB_HEAD_REF"
- id: tag
name: Determine tag
run: |
version="$(head -n 1 ./cicd/tag_deps_version.txt)"
ref_name="v$version"
old_version="$(head -n 1 ./cicd/tag-deps-version.txt)"
old_ref_name="v$old_version"
new_version="$(tail -n 1 ./cicd/tag-deps-version.txt)"
new_ref_name="v$new_version"
create=true
if [ "$(git ls-remote origin "refs/tags/$ref_name" | wc -l)" = "1" ]; then
if [ "$(git ls-remote origin "refs/tags/$new_ref_name" | wc -l)" = "1" ]; then
create=false
fi
echo "version=$version" | tee -a "$GITHUB_OUTPUT"
echo "ref-name=$ref_name" | tee -a "$GITHUB_OUTPUT"
echo "old-version=$old_version" | tee -a "$GITHUB_OUTPUT"
echo "old-ref-name=$old_ref_name" | tee -a "$GITHUB_OUTPUT"
echo "new-version=$new_version" | tee -a "$GITHUB_OUTPUT"
echo "new-ref-name=$new_ref_name" | tee -a "$GITHUB_OUTPUT"
echo "create=$create" | tee -a "$GITHUB_OUTPUT"
- if: ${{ fromJSON(steps.tag.outputs.create) }}
name: Tag
run: |
git tag "${{ steps.tag.outputs.ref-name }}"
git push origin "${{ steps.tag.outputs.ref-name }}"
commit="$(git rev-parse HEAD)"
git fetch origin refs/tags/"${{ steps.tag.outputs.old-ref-name }}"
git checkout -b deps "${{ steps.tag.outputs.old-ref-name }}"
git restore --source="$commit" ./cicd
git add ./cicd
if git commit -m "bump dependency release to ${{ steps.tag.outputs.new-version }}"; then
git tag "${{ steps.tag.outputs.new-ref-name }}"
git push origin "${{ steps.tag.outputs.new-ref-name }}"
fi
2 changes: 2 additions & 0 deletions cicd/tag-deps-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0.14.0
0.14.1
1 change: 0 additions & 1 deletion cicd/tag_deps_version.txt

This file was deleted.

0 comments on commit d95161f

Please sign in to comment.