Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: download release tarball from named release #492

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Sep 18, 2024

Avoid the need for using the commit hash to find the release.

Fixes: #491

See #491 for the question of whether we want to lock this behaviour in - release assets are only available for tags, not every commit on master as they used to be with CircleCI.

Avoid the need for using the commit hash to find the release.

Fixes: #491
@rvagg
Copy link
Member Author

rvagg commented Sep 18, 2024

Running it from this commit:

[download_release_tarball] failed to determine release tag
+ return 1
+ echo '[install-filcrypto/main] building libfilcrypto from local sources (dir = rust)'

Running it from 1.30.0-dev which has no assets:

+ echo '[download_release_tarball] acquiring release @ v1.30.0-dev'
[download_release_tarball] acquiring release @ v1.30.0-dev
++ curl --retry 3 --location https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/tags/v1.30.0-dev
...
[download_release_tarball] failed to download release (tag URL: https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/tags/v1.30.0-dev, response: {
  "url": "https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/174524183",
  "assets_url": "https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/174524183/assets",
...
  "body": "This is a developer release of Filecoin-FFI intended for testing out https://github.com/filecoin-project/filecoin-ffi/pull/480 and the nv24-skeleton.\r\n\r\n## What's Changed\r\n* ci: automate creation of GitHub releases and tags by @galargh in https://github.com/filecoin-project/filecoin-ffi/pull/475\r\n* feat: FFI_PORTABLE to build a maximally portable binary by @rvagg in https://github.com/filecoin-project/filecoin-ffi/pull/480\r\n\r\n\r\n**Full Changelog**: https://github.com/filecoin-project/filecoin-ffi/compare/v1.29.0-dev...v1.30.0-dev",
  "mentions_count": 2
})
+ return 1
+ echo '[install-filcrypto/main] building libfilcrypto from local sources (dir = rust)'

Running it from 1.30.0-dev2:

+ echo '[download_release_tarball] acquiring release @ v1.30.0-dev2'
[download_release_tarball] acquiring release @ v1.30.0-dev2
++ curl --retry 3 --location https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/tags/v1.30.0-dev2
...
++ jq -r '.assets[] | select(.name | contains("filecoin-ffi-Linux-x86_64-standard")) | .url'
+ local __release_url=https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/assets/193160603
++ basename https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/assets/193160603
+ local __tar_path=/tmp/filecoin-ffi-Linux-x86_64-standard_193160603.tar.gz
+ [[ -z https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/assets/193160603 ]]
++ curl --head --retry 3 --header Accept:application/octet-stream --location --output /dev/null -w '%{url_effective}' https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/assets/193160603
...

leading to a successful install

@rvagg rvagg merged commit 0d75839 into master Sep 24, 2024
5 checks passed
@rvagg rvagg deleted the rvagg/download-from-release branch September 24, 2024 23:40
@galargh
Copy link
Contributor

galargh commented Sep 28, 2024

Post-merge LGTM 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

ci: release assets cannot be downloaded by install-filcrypto
3 participants