Skip to content

Commit

Permalink
release trigger workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
battlmonstr committed Nov 22, 2023
1 parent e6b0679 commit 9413905
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Release

on: workflow_dispatch

jobs:
release_trigger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./ci/release_branch.sh
35 changes: 35 additions & 0 deletions ci/release_branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

SRC_GIT_URL="https://github.com/battlmonstr/silkworm.git"

function release_tag {
git ls-remote --tags "$SRC_GIT_URL" | grep capi | cut -d '-' -f 2 | while read tag
do
if ! git ls-remote --heads | grep "release/$tag" > /dev/null
then
echo $tag
break
fi
done
}

tag=$(release_tag)

if [[ -z "$tag" ]]
then
echo "release tag not found"
exit 1
fi

branch="release/$tag"
base_tag="${branch}-base"

echo "release tag: $tag"
echo "release branch: $branch"
echo "release base tag: $base_tag"

git checkout -b "$branch"
git push --set-upstream origin "$branch"

git tag "$base_tag"
git push --tags

0 comments on commit 9413905

Please sign in to comment.