Skip to content

Commit

Permalink
Fix release type
Browse files Browse the repository at this point in the history
  • Loading branch information
thespad committed Dec 21, 2024
1 parent e4fa08c commit eb1425a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
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
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
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')
echo "Type is \`github_devel\`" >> $GITHUB_STEP_SUMMARY
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')
echo "Type is \`github_stable\`" >> $GITHUB_STEP_SUMMARY
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY
Expand Down
30 changes: 15 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,23 @@ pipeline {
/* ########################
External Release Tagging
######################## */
// If this is a devel github release use the first in an array from github to determine the ext tag
stage("Set ENV github_devel"){
steps{
script{
env.EXT_RELEASE = sh(
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases | jq -r '.[0] | .tag_name' ''',
returnStdout: true).trim()
}
}
// If this is a stable github release use the latest endpoint from github to determine the ext tag
stage("Set ENV github_stable"){
steps{
script{
env.EXT_RELEASE = sh(
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
returnStdout: true).trim()
}
}
}
// If this is a stable or devel github release generate the link for the build message
stage("Set ENV github_link"){
steps{
script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
}
}
steps{
script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
}
}
}
// Sanitize the release tag and strip illegal docker or github characters
stage("Sanitize tag"){
Expand Down Expand Up @@ -980,7 +980,7 @@ pipeline {
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag"
sh '''#! /bin/bash
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
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
echo '{"tag_name":"'${META_TAG}'",\
"target_commitish": "master",\
"name": "'${META_TAG}'",\
Expand Down
2 changes: 1 addition & 1 deletion jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# jenkins variables
project_name: docker-airsonic-advanced
external_type: github_devel
external_type: github_stable
release_type: stable
release_tag: latest
ls_branch: master
Expand Down

0 comments on commit eb1425a

Please sign in to comment.