mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2024-11-16 17:05:32 +00:00
update auto_release workflow
This commit is contained in:
parent
d74298653d
commit
056a061229
22
.github/workflows/auto_release.yml
vendored
22
.github/workflows/auto_release.yml
vendored
|
@ -1,18 +1,13 @@
|
||||||
name: Automatic Release
|
name: Automatic Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- 'seafile-server/**'
|
|
||||||
- 'seahub/**'
|
|
||||||
- 'seahub-media/**'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
folder:
|
folder:
|
||||||
description: 'Which folder to release?'
|
description: 'Which folder to release?'
|
||||||
required: true
|
required: true
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create_release:
|
create_release:
|
||||||
|
@ -35,7 +30,7 @@ jobs:
|
||||||
FOLDER_CHANGED=${{ github.event.inputs.folder }}
|
FOLDER_CHANGED=${{ github.event.inputs.folder }}
|
||||||
else
|
else
|
||||||
echo "Manually triggered for folder $${{ github.event.inputs.folder }}, but current job is for folder $${{ matrix.folder }}. Skipping."
|
echo "Manually triggered for folder $${{ github.event.inputs.folder }}, but current job is for folder $${{ matrix.folder }}. Skipping."
|
||||||
exit 0
|
exit 78
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
CHANGED_FOLDERS=$(git diff --name-only HEAD^ HEAD | cut -d '/' -f1 | uniq)
|
CHANGED_FOLDERS=$(git diff --name-only HEAD^ HEAD | cut -d '/' -f1 | uniq)
|
||||||
|
@ -44,7 +39,7 @@ jobs:
|
||||||
|
|
||||||
if [ -z "$FOLDER_CHANGED" ]; then
|
if [ -z "$FOLDER_CHANGED" ]; then
|
||||||
echo "Skipping as ${{ matrix.folder }} didn't change."
|
echo "Skipping as ${{ matrix.folder }} didn't change."
|
||||||
exit 0
|
exit 78
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "FOLDER_CHANGED=$FOLDER_CHANGED" >> $GITHUB_ENV
|
echo "FOLDER_CHANGED=$FOLDER_CHANGED" >> $GITHUB_ENV
|
||||||
|
@ -75,6 +70,7 @@ jobs:
|
||||||
else
|
else
|
||||||
NEXT_BUILD="001"
|
NEXT_BUILD="001"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "NEXT_BUILD=$NEXT_BUILD" >> $GITHUB_ENV
|
echo "NEXT_BUILD=$NEXT_BUILD" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Get Commit Messages
|
- name: Get Commit Messages
|
||||||
|
@ -82,6 +78,7 @@ jobs:
|
||||||
id: get_messages
|
id: get_messages
|
||||||
run: |
|
run: |
|
||||||
MESSAGES=""
|
MESSAGES=""
|
||||||
|
|
||||||
if [[ -z "$LATEST_TAG" ]]; then
|
if [[ -z "$LATEST_TAG" ]]; then
|
||||||
COMMIT_RANGE="--all"
|
COMMIT_RANGE="--all"
|
||||||
else
|
else
|
||||||
|
@ -95,6 +92,10 @@ jobs:
|
||||||
MESSAGES="$MESSAGES- $commit: $MESSAGE"$'\n'
|
MESSAGES="$MESSAGES- $commit: $MESSAGE"$'\n'
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ -z "$MESSAGES" ]]; then
|
||||||
|
exit 78
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$FOLDER_CHANGED" == "seafile-caddy" ]]; then
|
if [[ "$FOLDER_CHANGED" == "seafile-caddy" ]]; then
|
||||||
MESSAGES="Caddy version: $SEAFILE_VERSION"$'\n'"Image build version: $NEXT_BUILD"$'\n'"Changelog:"$'\n'"$MESSAGES"
|
MESSAGES="Caddy version: $SEAFILE_VERSION"$'\n'"Image build version: $NEXT_BUILD"$'\n'"Changelog:"$'\n'"$MESSAGES"
|
||||||
|
@ -114,7 +115,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.FOLDER_CHANGED }}-${{ env.SEAFILE_VERSION }}_${{ env.NEXT_BUILD }}
|
tag_name: ${{ env.FOLDER_CHANGED }}-${{ env.SEAFILE_VERSION }}_${{ env.NEXT_BUILD }}
|
||||||
release_name: ${{ env.FOLDER_CHANGED }}-${{ env.SEAFILE_VERSION }}_${{ env.NEXT_BUILD }}
|
release_name: ${{ env.FOLDER_CHANGED }}-${{ env.SEAFILE_VERSION }}_${{ env.NEXT_BUILD }}
|
||||||
body: |
|
body: ${{ env.MESSAGES }}
|
||||||
${{ env.MESSAGES }}
|
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
Loading…
Reference in a new issue