-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,24 +58,15 @@ workflows: | |
# Note that you don't need to include title and changelog if you do not want to. | ||
# Any number of artifacts can be included with the release. | ||
- name: Discord notification | ||
script: | | ||
set -ex | ||
APP_LINK=$(echo $CM_ARTIFACT_LINKS | jq -r '.[] | select(.name=="app.aab") | .url') | ||
# Get first 7 digits of commit number | ||
COMMIT=$(echo "${CM_COMMIT}" | sed 's/^\(........\).*/\1/;q') | ||
# Get commit message | ||
COMMIT_MESSAGE=$(git log --format=%B -n 1 $CM_COMMIT) | ||
# Get commit author | ||
AUTHOR=$(git show -s --format='%ae' $CM_COMMIT) | ||
# Publish the notification | ||
curl -H "Content-Type: multipart/form-data" \ | ||
-F 'payload_json={"username" : "codemagic-bot", "content": "**Commit:** `'"$COMMIT"'`\n\n**Commit message:** '"$COMMIT_MESSAGE"'\n\n**Branch:** '"$CM_BRANCH"'\n\n**Author:** '"$AUTHOR"'\n\n**Artifacts: **\n\n'"$APP_LINK"'\n\n"}' \ | ||
$WEBHOOK_URL | ||
- name: Create a changelog | ||
script: | | ||
if [[ -z ${CM_PREVIOUS_COMMIT} ]] | ||
then | ||
echo "No finished builds found to generate changelog" | tee release_notes.txt | ||
else | ||
echo "$(git-changelog generate --previous-commit $CM_PREVIOUS_COMMIT)" | tee release_notes.txt | ||
fi | ||
artifacts: | ||
- build/**/outputs/**/*.aab | ||
- build/**/outputs/**/mapping.txt | ||
|
@@ -86,4 +77,24 @@ workflows: | |
- [email protected] | ||
notify: | ||
success: true | ||
failure: true | ||
failure: true | ||
scripts: | ||
- name: Discord notification | ||
script: | | ||
set -ex | ||
APP_LINK=$(echo $CM_ARTIFACT_LINKS | jq -r '.[] | select(.name=="app.aab") | .url') | ||
# Get first 7 digits of commit number | ||
COMMIT=$(echo "${CM_COMMIT}" | sed 's/^\(........\).*/\1/;q') | ||
# Get commit message | ||
COMMIT_MESSAGE=$(git log --format=%B -n 1 $CM_COMMIT) | ||
# Get commit author | ||
AUTHOR=$(git show -s --format='%ae' $CM_COMMIT) | ||
# Publish the notification | ||
curl -H "Content-Type: multipart/form-data" \ | ||
-F 'payload_json={"username" : "codemagic-bot", "content": "**Commit:** `'"$COMMIT"'`\n\n**Commit message:** '"$COMMIT_MESSAGE"'\n\n**Branch:** '"$CM_BRANCH"'\n\n**Author:** '"$AUTHOR"'\n\n**Artifacts: **\n\n'"$APP_LINK"'\n\n"}' \ | ||
-F "file1=@release_notes.txt" \ | ||
$WEBHOOK_URL |