Skip to content

Commit

Permalink
update auto_release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ggogel committed Aug 26, 2023
1 parent 1c87a27 commit 0ed5779
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
LATEST_TAG=$(curl -sH "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/tags" | \
jq -r --arg FOLDER "$FOLDER_CHANGED" --arg VERSION "$SEAFILE_VERSION" '.[] | select(.name | startswith($FOLDER + "-" + $VERSION)) | .name' | sort -V | tail -1)
echo "LATEST_TAG=$LATEST_TAG"
if [[ $LATEST_TAG ]]; then
Expand All @@ -54,11 +54,26 @@ jobs:
echo "NEXT_BUILD=$NEXT_BUILD" >> $GITHUB_ENV
echo "NEXT_BUILD = $NEXT_BUILD"
- name: Get Last Tag for Folder
id: last_tag
run: |
LAST_TAG=$(curl -sH "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/tags" | \
jq -r --arg FOLDER "$FOLDER_CHANGED" --arg VERSION "$SEAFILE_VERSION" '.[] | select(.name | startswith($FOLDER + "-" + $VERSION)) | .name' | sort -V | tail -1)
if [[ -z "$LAST_TAG" ]]; then
echo "LAST_TAG=0" >> $GITHUB_ENV
else
echo "LAST_TAG=$LAST_TAG" >> $GITHUB_ENV
- name: Get Commit Messages
id: commit_messages
run: |
MESSAGES=$(git log --pretty=format:"%s" $(git describe --tags --abbrev=0)..HEAD -- $FOLDER_CHANGED)
MESSAGES=""
for commit in $(git log --since="$LAST_TAG..HEAD" --pretty=format:'%H' -- $FOLDER_CHANGED); do
MESSAGE=$(git log --format=%B -n 1 $commit)
MESSAGES="$MESSAGES$commit: $MESSAGE\n"
done
echo "MESSAGES=$MESSAGES" >> $GITHUB_ENV
echo "MESSAGES=$MESSAGES"
- name: Create Release
if: env.FOLDER_CHANGED != '' && env.SEAFILE_VERSION != ''
Expand Down

0 comments on commit 0ed5779

Please sign in to comment.