Skip to content

Commit eb1425a

Browse files
committed
Fix release type
1 parent e4fa08c commit eb1425a

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

.github/workflows/external_trigger.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
2424
echo "> External trigger running off of master branch. To disable this trigger, add \`airsonic-advanced_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
2525
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
26-
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/kagemomiji/airsonic-advanced/releases" | jq -r '.[0] | .tag_name')
27-
echo "Type is \`github_devel\`" >> $GITHUB_STEP_SUMMARY
26+
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/kagemomiji/airsonic-advanced/releases/latest" | jq -r '. | .tag_name')
27+
echo "Type is \`github_stable\`" >> $GITHUB_STEP_SUMMARY
2828
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2929
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3030
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY

Jenkinsfile

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,23 @@ pipeline {
129129
/* ########################
130130
External Release Tagging
131131
######################## */
132-
// If this is a devel github release use the first in an array from github to determine the ext tag
133-
stage("Set ENV github_devel"){
134-
steps{
135-
script{
136-
env.EXT_RELEASE = sh(
137-
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases | jq -r '.[0] | .tag_name' ''',
138-
returnStdout: true).trim()
139-
}
140-
}
132+
// If this is a stable github release use the latest endpoint from github to determine the ext tag
133+
stage("Set ENV github_stable"){
134+
steps{
135+
script{
136+
env.EXT_RELEASE = sh(
137+
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
138+
returnStdout: true).trim()
139+
}
140+
}
141141
}
142142
// If this is a stable or devel github release generate the link for the build message
143143
stage("Set ENV github_link"){
144-
steps{
145-
script{
146-
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
147-
}
148-
}
144+
steps{
145+
script{
146+
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
147+
}
148+
}
149149
}
150150
// Sanitize the release tag and strip illegal docker or github characters
151151
stage("Sanitize tag"){
@@ -980,7 +980,7 @@ pipeline {
980980
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
981981
echo "Pushing New release for Tag"
982982
sh '''#! /bin/bash
983-
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases | jq '.[0] |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
983+
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
984984
echo '{"tag_name":"'${META_TAG}'",\
985985
"target_commitish": "master",\
986986
"name": "'${META_TAG}'",\

jenkins-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# jenkins variables
44
project_name: docker-airsonic-advanced
5-
external_type: github_devel
5+
external_type: github_stable
66
release_type: stable
77
release_tag: latest
88
ls_branch: master

0 commit comments

Comments
 (0)