diff --git a/devel/own-projects/release-on-github.sh b/devel/own-projects/release-on-github.sh new file mode 100755 index 00000000..21f33c96 --- /dev/null +++ b/devel/own-projects/release-on-github.sh @@ -0,0 +1,34 @@ +#!/usr/bin/bash +set -e # abort on first error +shopt -s nullglob +source versions.sh + +# release latest version of my projects on GitHub (if not already released yet) +for project in "${!versions[@]}" +do + version=${versions[$project]} + gh_name=${github_names[$project]:-$project} + [[ $gh_name == 'skip' ]] && continue + [[ $version == 'none' ]] && continue + echo '------------------------------------------------------------------------' + echo "NEXT: $project -> $version" + + # check whether release already exists + if github-release info --user martchus --repo "$gh_name" --tag "v$version"; then + echo "auto-skipping $project -> v$version; release already present" + continue + fi + + # promt + read -p "release $project -> v$version [y/n]? " -n 1 -r + echo + [[ $REPLY =~ ^[Yy]$ ]] || continue + + # create release + if github-release release --user martchus --repo "$gh_name" --tag "v$version"; then + echo "SUCCESS: released $project -> $version" + else + echo "FAILURE: unable to create release $project -> $version" + exit -1 + fi +done diff --git a/devel/own-projects/upload-mingw-w64-to-github.sh b/devel/own-projects/upload-mingw-w64-to-github.sh new file mode 100755 index 00000000..2208048d --- /dev/null +++ b/devel/own-projects/upload-mingw-w64-to-github.sh @@ -0,0 +1,50 @@ +#!/usr/bin/bash +set -e # abort on first error +shopt -s nullglob +source versions.sh + +repo_dir=${PATH_REPO_OWNSTUFF} +if ! [[ $repo_dir ]]; then + echo "\$PATH_REPO_OWNSTUFF is empty." + exit -1 +fi +repo_dir+='/x86_64' +if ! [[ -d $repo_dir ]]; then + echo "\$PATH_REPO_OWNSTUFF/x86_64 does not point to a directory." + exit -1 +fi + +# upload latest static mingw-w64 package of my projects on GitHub (if not already present) +for project in "${!versions[@]}" +do + version=${versions[$project]} + gh_name=${github_names[$project]:-$project} + [[ $gh_name == 'skip' ]] && continue + [[ $version == 'none' ]] && continue + echo '------------------------------------------------------------------------' + echo "NEXT: $project/v$version" + + # determine file path + files=("$repo_dir/mingw-w64-$project-static-$version"-*-*.pkg.tar.xz) + if [[ ${#files[@]} == 0 ]]; then + echo "no static mingw-w64 package for $project/v$version present" + continue + fi + latest_file=${files[-1]} + file_name=${latest_file##*/} + + # check whether upload already exists + if github-release info --user martchus --repo "$gh_name" --tag "v$version" | grep "artefact: $latest_file"; then + echo "auto-skipping $project/v$version; $latest_file already present" + continue + fi + + # upload file + echo "uploading $project/v$version -> $latest_file" + if github-release upload --user martchus --repo "$gh_name" --tag "v$version" --file "$latest_file" --name "$file_name"; then + echo "SUCCESS: uploaded $project/v$version -> $latest_file" + else + echo "FAILURE: unable to upload $project/v$version -> $latest_file" + exit -1 + fi +done diff --git a/devel/own-projects/versions.sh b/devel/own-projects/versions.sh index 9b4d3cb5..5309e269 100755 --- a/devel/own-projects/versions.sh +++ b/devel/own-projects/versions.sh @@ -13,3 +13,7 @@ declare -A versions=( [dbus-soundrecorder]=1.2.2 [qt5]=5.10.1 ) +declare -A github_names=( + [c++utilities]=cpp-utilities + [qt5]=skip +)