Skip to content

Commit

Permalink
feat: new release creation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
iheredia committed Apr 18, 2024
1 parent d0378da commit 7ce6b8d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ on:
push:
branches:
- master
- tmp_master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@master
with:
fetch-depth: "0"
- name: Bump version and push tag
uses: urbanmedia/github-tag-action@tmp_master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 25 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# config
default_semvar_bump=${DEFAULT_BUMP:-patch}
with_v=${WITH_V:-false}
release_branches=${RELEASE_BRANCHES:-master}
release_branches=${RELEASE_BRANCHES:-tmp_master}
custom_tag=${CUSTOM_TAG}
source=${SOURCE:-.}
dryrun=${DRY_RUN:-false}
create_release=${CREATE_RELEASE:-false}

# see https://github.blog/2022-04-12-git-security-vulnerability-announced/
git config --global --add safe.directory /github/workspace
Expand Down Expand Up @@ -128,9 +129,29 @@ EOF

if [ $? -eq 0 ]
then
echo "Success"
exit 0
echo "Tag created successfully"
else
echo "curl failed" >&2
echo "Error while creating tag" >&2
exit 1
fi

if $create_release
then
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${new}" \
--generate-notes \
--notes-start-tag="${$tag}";
else
echo "Skipping release creation"
exit 0;
fi

if [ $? -eq 0 ]
then
echo "Release created successfully"
exit 0;
else
echo "Error while creating release" >&2
exit 1
fi

0 comments on commit 7ce6b8d

Please sign in to comment.