Skip to content

Commit

Permalink
Add github releases
Browse files Browse the repository at this point in the history
  • Loading branch information
MBeijer committed Aug 18, 2022
1 parent cbe9ced commit b2bdf19
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,36 @@ def buildStep(dockerImage, os, flags) {
).trim()
sh "VERBOSE=1 cmake --build . --config Release -- -j${_NPROCESSORS_ONLN}"
sh "VERBOSE=1 cmake --build . --config Release --target package -- -j${_NPROCESSORS_ONLN}"

def archive_date = sh (
script: 'date +"%Y%m%d-%H%M"',
returnStdout: true
).trim()
def release_type = ("${fixed_job_name}-").replace('/','-').replace('MilkyTracker-','').replace('master-','');
dir("milkytracker") {
sh "unzip ../*.zip"
sh "mv -fv ./* ./MilkyTracker"
sh "cp ../../../resources/packaging/amigaos/milkytracker_dir.info ./MilkyTracker.info"
def archive_date = sh (
script: 'date +"%Y%m%d-%H%M"',
returnStdout: true
).trim()
def release_type = ("${fixed_job_name}-").replace('/','-').replace('MilkyTracker-','').replace('master-','');

sh "lha -c ../milkytracker-${os}-${release_type}${archive_date}.lha *"
}

if (!env.CHANGE_ID) {
def release_type_tag = 'develop';
def pre_release = '--pre-release';
if (env.TAG_NAME) {
pre_release = '';
release_type_tag = env.TAG_NAME;
} else if (env.BRANCH_NAME.equals('master')) {
release_type_tag = 'nightly';
}

try {
sh "github-release release --user amigaports --repo milkytracker --tag ${release_type_tag} --name \"milkytracker ${release_type_tag}\" --description \"${release_type_tag} releases\" ${pre_release}"
} catch(err) {

}
sh "github-release upload --user amigaports --repo milkytracker --tag ${release_type_tag} --name \"milkytracker-${os}-${release_type}${archive_date}.lha\" --file milkytracker-${os}-${release_type}${archive_date}.lha"
}
archiveArtifacts artifacts: "**.lha"
stash includes: "**.lha", name: "${os}"
}
Expand Down

0 comments on commit b2bdf19

Please sign in to comment.