-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Publish precompiled to s3 on releasing #12242
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
Publish precompiled to s3 on releasing #12242
Conversation
Co-authored-by: wingyplus <wingyminus@gmail.com>
Co-authored-by: wingyplus <wingyminus@gmail.com>
Co-authored-by: wingyplus <wingyminus@gmail.com>
.github/workflows/release.yml
Outdated
| gh release upload --clobber "${{ github.ref_name }}" \ | ||
| Docs.zip \ | ||
| Docs.zip.sha{1,256}sum | ||
| - name: Upload Precompiled to S3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking we should keep those separate:
- We can move this to the repo.hex.pm task
- We can change repo.hex.pm to run on tags too
WDYT?
The idea is to keep this only specific to GitHub and the other one to Hex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* moves Precompiled.zip to elixir.zip * uploads elixir.zip to S3 * uploads build_txt to S3
6112488 to
3a18d82
Compare
| sed -i "/^${ref_name}${{ matrix.otp }} /d" builds.txt | ||
| echo -e "${ref_name}${{ matrix.otp }} ${{ github.sha }} ${date} ${build_sha256} \n$(cat builds.txt)" > builds.txt | ||
| sort -u -k1,1 -o builds.txt builds.txt | ||
| aws s3 cp builds.txt s3://${{ env.AWS_S3_BUCKET }}/builds/elixir/builds.txt --cache-control "public,max-age=3600" --metadata '{"surrogate-key":"builds","surrogate-control":"public,max-age=604800"}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also purge or is that not necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, at least I can't see it in upload_builds_txt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to purge, it's happening here: https://github.com/hexpm/bob/blob/ab6e9db2df0ed0abcf1b5c81178d2c83237b267c/priv/scripts/elixir/elixir.sh#L43.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
/cc @ericmj @wojtekmach |
ericmj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just left one comment about the purging, otherwise it looks great. Thank you @gilacost!
😍 |
Co-authored-by: Eric Meadows-Jönsson <eric.meadows.jonsson@gmail.com>
.github/workflows/repo.hex.pm.yml
Outdated
| AWS_REGION: ${{ secrets.HEX_AWS_REGION }} | ||
| AWS_S3_BUCKET: ${{ secrets.HEX_AWS_S3_BUCKET }} | ||
| run: | | ||
| mv elixir-otp-${{ matrix.otp }}.zip elixir.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this mv right? We can directly aws s3 cp the first one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might not be necessary but as I can not list the items in the bucket I limited myself to copy and paste from bob.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: José Valim <jose.valim@gmail.com>
I updated the code after your comment, maybe it makes more sense now. For the build on the oldest OTP version we also upload a version without the -otp- suffix and add it to the builds.txt file. |
| purge_key $1 | ||
| } | ||
| EOF | ||
| chmod +x utils.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice solution to the code duplication.
|
Is there anything else that we need to do to get this merged? 😄 Please let me know if I can help in any way 😛 |
|
💚 💙 💜 💛 ❤️ |
elixir.zipelixir-otp-${{ matrix.otp }}.zipUploads hexdocs to S3 for each applicationpurges fastlycloses Automate docs publishing to Hexdocs with GitHub Actions #12038
## Next steps* we can create a new composite action that uploads HexDocs to s3* use this action inrelease.ymlandrepo.hex.pm.yml