mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2024-11-16 09:01:38 +00:00
Update auto_release.yml
This commit is contained in:
parent
a21eae4941
commit
3b618557fc
14
.github/workflows/auto_release.yml
vendored
14
.github/workflows/auto_release.yml
vendored
|
@ -27,11 +27,19 @@ jobs:
|
|||
LATEST_TAG=$(git describe --tags --abbrev=0 --match "${{ matrix.folder }}-*" 2>/dev/null)
|
||||
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
|
||||
|
||||
if [[ -n "$LATEST_TAG" ]]; then
|
||||
PREVIOUS_BUILD=$(echo $LATEST_TAG | awk -F_ '{print $2}')
|
||||
NEXT_BUILD=$(printf "%03d" $((PREVIOUS_BUILD + 1)))
|
||||
PREVIOUS_VERSION=$(echo $LATEST_TAG | awk -F_ '{print $1}' | awk -F- '{print $2}')
|
||||
PREVIOUS_BUILD=$(echo $LATEST_TAG | awk -F_ '{print $2}')
|
||||
|
||||
if [[ "${{ matrix.folder }}" == "seafile-caddy" ]]; then
|
||||
CURRENT_VERSION=$(grep -m 1 'FROM caddy:' ${{ matrix.folder }}/Dockerfile | awk -F':' '{print $2}' | awk -F'-' '{print $1}' | tr -d '\n')
|
||||
else
|
||||
CURRENT_VERSION=$(grep -m 1 'SEAFILE_VERSION' ${{ matrix.folder }}/Dockerfile | awk -F'SEAFILE_VERSION=' '{print $2}' | awk '{print $1}' | tr -d '\n')
|
||||
fi
|
||||
|
||||
if [[ "$PREVIOUS_VERSION" != "$CURRENT_VERSION" ]] || [[ -z "$LATEST_TAG" ]]; then
|
||||
NEXT_BUILD="001"
|
||||
else
|
||||
NEXT_BUILD=$(printf "%03d" $((PREVIOUS_BUILD + 1)))
|
||||
fi
|
||||
echo "NEXT_BUILD=$NEXT_BUILD" >> $GITHUB_ENV
|
||||
|
||||
|
|
Loading…
Reference in a new issue