ci: add continuous release workflow for rolling VPM pre-releases
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ index_url=${VPM_INDEX_URL:-$host/$project/raw/branch/main/vpm/index.json}
|
||||
release_base=${VPM_RELEASE_BASE:-}
|
||||
|
||||
id=$(jq -r .name "$pkg/package.json")
|
||||
version=$(jq -r .version "$pkg/package.json")
|
||||
version=${VPM_VERSION:-$(jq -r .version "$pkg/package.json")}
|
||||
zip_name="$id-$version.zip"
|
||||
: "${release_base:=$host/$project/releases/download/v$version}"
|
||||
zip_url="$release_base/$zip_name"
|
||||
|
||||
+11
-1
@@ -14,12 +14,22 @@ root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
manifest="$root/csharp/dev.doloro.animator-as-crab/package.json"
|
||||
|
||||
id=$(jq -r .name "$manifest")
|
||||
version=$(jq -r .version "$manifest")
|
||||
version=${VPM_VERSION:-$(jq -r .version "$manifest")}
|
||||
zip="$root/vpm/dist/$id-$version.zip"
|
||||
|
||||
zip_name=$(basename "$zip")
|
||||
[ -f "$zip" ] || { echo "missing $zip; run package.sh first" >&2; exit 1; }
|
||||
|
||||
# Delete existing release with same tag if present (needed for rolling tags like continuous)
|
||||
existing=$(curl -fsS -H "Authorization: token $TOKEN" \
|
||||
"$SERVER/api/v1/repos/$REPO/releases/tags/$TAG" 2>/dev/null || true)
|
||||
if [ -n "$existing" ] && [ "$existing" != 'null' ]; then
|
||||
existing_id=$(jq -r .id <<<"$existing")
|
||||
echo "deleting existing release $existing_id for tag $TAG"
|
||||
curl -fsS -X DELETE -H "Authorization: token $TOKEN" \
|
||||
"$SERVER/api/v1/repos/$REPO/releases/$existing_id"
|
||||
fi
|
||||
|
||||
release=$(curl -fsS -X POST \
|
||||
-H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
|
||||
"$SERVER/api/v1/repos/$REPO/releases" \
|
||||
|
||||
Reference in New Issue
Block a user