Skip to content

Commit 58b6478

Browse files
Bot Updating Templated Files
1 parent 9887cdc commit 58b6478

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

Jenkinsfile

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,25 +1003,25 @@ pipeline {
10031003
environment name: 'EXIT_STATUS', value: ''
10041004
}
10051005
steps {
1006-
echo "Auto-generating release notes"
1007-
sh '''if [ "$(git tag --points-at HEAD)" != "" ]; then
1008-
echo "Existing tag points to current commit, suggesting no new LS changes"
1009-
AUTO_RELEASE_NOTES="No changes"
1010-
else
1011-
AUTO_RELEASE_NOTES=$(curl -fsL -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github+json" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases/generate-notes \
1012-
-d '{"tag_name":"'${META_TAG}'",\
1013-
"target_commitish": "master"}' \
1014-
| jq -r '.body' | sed 's|## What.s Changed||')
1015-
fi'''
1016-
echo "Pushing New tag for current commit ${META_TAG}"
1017-
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
1018-
-d '{"tag":"'${META_TAG}'",\
1019-
"object": "'${COMMIT_SHA}'",\
1020-
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
1021-
"type": "commit",\
1022-
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
1023-
echo "Pushing New release for Tag"
10241006
sh '''#! /bin/bash
1007+
echo "Auto-generating release notes"
1008+
if [ "$(git tag --points-at HEAD)" != "" ]; then
1009+
echo "Existing tag points to current commit, suggesting no new LS changes"
1010+
AUTO_RELEASE_NOTES="No changes"
1011+
else
1012+
AUTO_RELEASE_NOTES=$(curl -fsL -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github+json" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases/generate-notes \
1013+
-d '{"tag_name":"'${META_TAG}'",\
1014+
"target_commitish": "master"}' \
1015+
| jq -r '.body' | sed 's|## What.s Changed||')
1016+
fi
1017+
echo "Pushing New tag for current commit ${META_TAG}"
1018+
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
1019+
-d '{"tag":"'${META_TAG}'",\
1020+
"object": "'${COMMIT_SHA}'",\
1021+
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
1022+
"type": "commit",\
1023+
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}'
1024+
echo "Pushing New release for Tag"
10251025
echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json
10261026
jq -n \
10271027
--arg tag_name "$META_TAG" \
@@ -1036,7 +1036,8 @@ pipeline {
10361036
"body": ("**CI Report:**\\n\\n" + $ci_url + "\\n\\n**LinuxServer Changes:**\\n\\n" + $ls_notes + "\\n\\n**Remote Changes:**\\n\\n" + $remote_notes),
10371037
"draft": false,
10381038
"prerelease": false }' > releasebody.json.done
1039-
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
1039+
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done
1040+
'''
10401041
}
10411042
}
10421043
// Add protection to the release branch

0 commit comments

Comments
 (0)