Skip to content

Commit

Permalink
Merge pull request #6256 from filecoin-project/mg/fix/ci-publish
Browse files Browse the repository at this point in the history
fix(ci): Updates to lotus CI build process
  • Loading branch information
jennijuju authored May 15, 2021
2 parents 9ffd4ad + eccdff4 commit 5611770
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ executors:
resource_class: 2xlarge
ubuntu:
docker:
- image: ubuntu:19.10
- image: ubuntu:20.04

commands:
install-deps:
Expand Down
20 changes: 15 additions & 5 deletions scripts/publish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ RELEASE_ID=`echo "${RELEASE_RESPONSE}" | jq '.id'`
if [ "${RELEASE_ID}" = "null" ]; then
echo "creating release"

COND_CREATE_DISCUSSION=""
PRERELEASE=true
if [[ ${CIRCLE_TAG} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
COND_CREATE_DISCUSSION="\"discussion_category_name\": \"announcement\","
PRERELEASE=false
fi

RELEASE_DATA="{
\"tag_name\": \"${CIRCLE_TAG}\",
\"target_commitish\": \"${CIRCLE_SHA1}\",
${COND_CREATE_DISCUSSION}
\"name\": \"${CIRCLE_TAG}\",
\"body\": \"\",
\"prerelease\": false
\"prerelease\": ${PRERELEASE}
}"

# create it if it doesn't exist yet
Expand All @@ -51,26 +59,28 @@ else
fi

RELEASE_UPLOAD_URL=`echo "${RELEASE_RESPONSE}" | jq -r '.upload_url' | cut -d'{' -f1`
echo "Preparing to send artifacts to ${RELEASE_UPLOAD_URL}"

bundles=(
artifacts=(
"lotus_${CIRCLE_TAG}_linux-amd64.tar.gz"
"lotus_${CIRCLE_TAG}_linux-amd64.tar.gz.cid"
"lotus_${CIRCLE_TAG}_linux-amd64.tar.gz.sha512"
"lotus_${CIRCLE_TAG}_darwin-amd64.tar.gz"
"lotus_${CIRCLE_TAG}_darwin-amd64.tar.gz.cid"
"lotus_${CIRCLE_TAG}_darwin-amd64.tar.gz.sha512"
)
for RELEASE_FILE in "${bundles[@]}"

for RELEASE_FILE in "${artifacts[@]}"
do
echo "Uploading release bundle: ${RELEASE_FILE}"
echo "Uploading ${RELEASE_FILE}..."
curl \
--request POST \
--header "Authorization: token ${GITHUB_TOKEN}" \
--header "Content-Type: application/octet-stream" \
--data-binary "@${RELEASE_FILE}" \
"$RELEASE_UPLOAD_URL?name=$(basename "${RELEASE_FILE}")"

echo "Release bundle uploaded: ${RELEASE_FILE}"
echo "Uploaded ${RELEASE_FILE}"
done

popd
Expand Down

0 comments on commit 5611770

Please sign in to comment.