|
|
|
@ -9,6 +9,12 @@ jobs:
|
|
|
|
|
increment-version:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
if: github.base_ref == 'nightly' && github.event.pull_request.merged
|
|
|
|
|
outputs:
|
|
|
|
|
version: ${{ steps.update-version.outputs.version }}
|
|
|
|
|
build-value: ${{ steps.update-version.outputs.build-value }}
|
|
|
|
|
commit-msg: ${{ steps.update-version.outputs.commit-msg }}
|
|
|
|
|
commit-hash: ${{ steps.update-version.outputs.commit-hash }}
|
|
|
|
|
commit-short: ${{ steps.update-version.outputs.commit-short }}
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
|
|
- name: Create App Token
|
|
|
|
@ -26,21 +32,31 @@ jobs:
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
|
|
- name: Update VERSION File
|
|
|
|
|
id: update-version
|
|
|
|
|
run: |
|
|
|
|
|
value=$(cat VERSION)
|
|
|
|
|
old_msg=$(git log -1 HEAD --pretty=format:%s)
|
|
|
|
|
|
|
|
|
|
if [[ "$value" == *"-"* ]]; then
|
|
|
|
|
version="${value%-build*}"
|
|
|
|
|
build_value="$((${value#*-build} + 1))"
|
|
|
|
|
new_value="${value%-build*}-build${build_value}"
|
|
|
|
|
new_msg="[${build_value}] ${old_msg}"
|
|
|
|
|
new_value="${version}-build${build_value}"
|
|
|
|
|
elif [[ "$value" == *"!"* ]]; then
|
|
|
|
|
new_value="${value%!*}"
|
|
|
|
|
new_msg="[${new_value}] ${old_msg}"
|
|
|
|
|
version="${value%!*}"
|
|
|
|
|
new_value="${version}"
|
|
|
|
|
build_value="${new_value}"
|
|
|
|
|
else
|
|
|
|
|
new_value="${value%-build*}-build1"
|
|
|
|
|
new_msg="[1] ${old_msg}"
|
|
|
|
|
version="${value%-build*}"
|
|
|
|
|
build_value="1"
|
|
|
|
|
new_value="${version}-build${build_value}"
|
|
|
|
|
fi
|
|
|
|
|
new_msg="[${build_value}] ${old_msg}"
|
|
|
|
|
|
|
|
|
|
echo "version=${version}" >> $GITHUB_OUTPUT
|
|
|
|
|
echo "build-value=${build_value}" >> $GITHUB_OUTPUT
|
|
|
|
|
echo "commit-msg=${old_msg}" >> $GITHUB_OUTPUT
|
|
|
|
|
echo "commit-hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
|
echo "commit-short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
|
|
echo "$new_value" > "VERSION"
|
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
@ -80,7 +96,7 @@ jobs:
|
|
|
|
|
|
|
|
|
|
docker-build:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
needs: [ verify-changes ]
|
|
|
|
|
needs: [ increment-version, verify-changes ]
|
|
|
|
|
if: needs.verify-changes.outputs.build == 'true'
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
|
@ -147,17 +163,18 @@ jobs:
|
|
|
|
|
|
|
|
|
|
commit-notification:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
needs: [ docker-build, verify-changes ]
|
|
|
|
|
if: ${{ success() && needs.verify-changes.outputs.build == 'true' }}
|
|
|
|
|
needs: [ increment-version, verify-changes, docker-build ]
|
|
|
|
|
if: ${{ success() && needs.increment-version.outputs.build == 'true' }}
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
|
|
- name: Send Discord Commit Notification
|
|
|
|
|
uses: Kometa-Team/discord-notifications@master
|
|
|
|
|
with:
|
|
|
|
|
webhook_id_token: ${{ secrets.NIGHTLY_WEBHOOK }}
|
|
|
|
|
title: ${{ vars.TEXT_COMMITS }}
|
|
|
|
|
title: Kometa ${{ needs.verify-changes.outputs.version }} Build ${{ needs.verify-changes.outputs.build-value }}
|
|
|
|
|
url: https://github.com/Kometa-Team/Kometa/commit/${{ needs.verify-changes.outputs.commit-hash }}
|
|
|
|
|
description: ${{ needs.verify-changes.outputs.commit-msg }}
|
|
|
|
|
message: "<@&967002147520675840> - An update to Kometa has now been published and is available to users of the **nightly** branch."
|
|
|
|
|
commits: "true"
|
|
|
|
|
color: ${{ vars.COLOR_SUCCESS }}
|
|
|
|
|
username: ${{ vars.BOT_NAME }}
|
|
|
|
|
avatar_url: ${{ vars.BOT_IMAGE }}
|
|
|
|
|