More CI packaging work

parent e339e4f5
...@@ -134,29 +134,17 @@ if [ -z "$is_nightly" ]; then ...@@ -134,29 +134,17 @@ if [ -z "$is_nightly" ]; then
.packages[0].platforms[0].checksum = \"SHA-256:$sha\"" .packages[0].platforms[0].checksum = \"SHA-256:$sha\""
fi fi
cat $srcdir/package/package_pico_index.template.json | \ cat $srcdir/package/package_pico_index.template.json | \
jq "$jq_arg" > package_rp2040_index.json jq "$jq_arg" > package_rp2040_index.json
#exit # Get previous release name
curl --silent https://api.github.com/repos/earlephilhower/arduino-pico/releases > releases.json
if [ -z "prev_any_release" ]; then # Previous final release (prerelase == false)
# Use Github API token, if available prev_release=$(jq -r '. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' releases.json)
curl_gh_token_arg=() # Previous release (possibly a pre-release)
if [ ! -z "$CI_GITHUB_API_KEY" ]; then prev_any_release=$(jq -r '. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' releases.json)
curl_gh_token_arg=(-H "Authorization: token $CI_GITHUB_API_KEY") # Previous pre-release
fi prev_pre_release=$(jq -r '. | map(select(.draft == false and .prerelease == true)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' releases.json)
# Get previous release name
curl --silent "${curl_gh_token_arg[@]}" https://api.github.com/repos/earlephilhower/arduino-pico/releases > releases.json
# Previous final release (prerelase == false)
prev_release=$(jq -r '. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' releases.json)
# Previous release (possibly a pre-release)
prev_any_release=$(jq -r '. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' releases.json)
# Previous pre-release
prev_pre_release=$(jq -r '. | map(select(.draft == false and .prerelease == true)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' releases.json)
else
prev_any_release=$prev_release
fi
echo "Previous release: $prev_release" echo "Previous release: $prev_release"
echo "Previous (pre-?)release: $prev_any_release" echo "Previous (pre-?)release: $prev_any_release"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment