update auto_release workflow

This commit is contained in:
Gerrit Gogel 2023-08-27 10:50:24 +02:00
parent 9f94873edf
commit 43f61c501c

View file

@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
folder: ['seafile-server', 'seahub', 'seahub-media'] folder: ['seafile-server', 'seahub', 'seahub-media', 'seafile-caddy']
fail-fast: false fail-fast: false
steps: steps:
- name: Check out code - name: Check out code
@ -50,8 +50,13 @@ jobs:
echo "FOLDER_CHANGED=$FOLDER_CHANGED" >> $GITHUB_ENV echo "FOLDER_CHANGED=$FOLDER_CHANGED" >> $GITHUB_ENV
if [[ -f "$FOLDER_CHANGED/Dockerfile" ]]; then if [[ -f "$FOLDER_CHANGED/Dockerfile" ]]; then
SEAFILE_VERSION=$(grep -m 1 'SEAFILE_VERSION' $FOLDER_CHANGED/Dockerfile | awk -F'SEAFILE_VERSION=' '{print $2}' | awk '{print $1}' | tr -d '\n') if [[ "$FOLDER_CHANGED" == "seafile-caddy" ]]; then
echo "SEAFILE_VERSION=$SEAFILE_VERSION" >> $GITHUB_ENV CADDY_VERSION=$(grep -m 1 'FROM caddy:' $FOLDER_CHANGED/Dockerfile | awk -F':' '{print $2}' | awk -F'-' '{print $1}' | tr -d '\n')
echo "SEAFILE_VERSION=$CADDY_VERSION" >> $GITHUB_ENV
else
SEAFILE_VERSION=$(grep -m 1 'SEAFILE_VERSION' $FOLDER_CHANGED/Dockerfile | awk -F'SEAFILE_VERSION=' '{print $2}' | awk '{print $1}' | tr -d '\n')
echo "SEAFILE_VERSION=$SEAFILE_VERSION" >> $GITHUB_ENV
fi
fi fi
- name: Get Previous Tag and Build Number - name: Get Previous Tag and Build Number
@ -91,7 +96,12 @@ jobs:
fi fi
done done
MESSAGES="Seafile version: $SEAFILE_VERSION"$'\n'"Image build version: $NEXT_BUILD"$'\n'"Changelog:"$'\n'"$MESSAGES" if [[ "$FOLDER_CHANGED" == "seafile-caddy" ]]; then
MESSAGES="Caddy version: $SEAFILE_VERSION"$'\n'"Image build version: $NEXT_BUILD"$'\n'"Changelog:"$'\n'"$MESSAGES"
else
MESSAGES="Seafile version: $SEAFILE_VERSION"$'\n'"Image build version: $NEXT_BUILD"$'\n'"Changelog:"$'\n'"$MESSAGES"
fi
echo "FORMATTED_MESSAGES=${MESSAGES//$'\n'/'%0A'}" >> $GITHUB_ENV echo "FORMATTED_MESSAGES=${MESSAGES//$'\n'/'%0A'}" >> $GITHUB_ENV
- name: Create Release - name: Create Release