Skip to content

Conversation

@gilacost
Copy link
Contributor

@gilacost gilacost commented Nov 15, 2022

## Next steps
* we can create a new composite action that uploads HexDocs to s3
* use this action in release.yml and repo.hex.pm.yml

Josep Lluis Giralt D'Lacoste and others added 3 commits November 15, 2022 20:50
Co-authored-by: wingyplus  <wingyminus@gmail.com>
Co-authored-by: wingyplus  <wingyminus@gmail.com>
Co-authored-by: wingyplus  <wingyminus@gmail.com>
@gilacost gilacost changed the title publish precompiled to s3 on releasing Publish precompiled to s3 on releasing Nov 15, 2022
gh release upload --clobber "${{ github.ref_name }}" \
Docs.zip \
Docs.zip.sha{1,256}sum
- name: Upload Precompiled to S3
Copy link
Member

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:

  1. We can move this to the repo.hex.pm task
  2. 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

Copy link
Contributor Author

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
@gilacost gilacost force-pushed the publish-precompiled-to-s3-on-releasing branch from 6112488 to 3a18d82 Compare November 15, 2022 19:14
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"}'
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josevalim
Copy link
Member

/cc @ericmj @wojtekmach

Copy link
Member

@ericmj ericmj left a 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!

@gilacost
Copy link
Contributor Author

Just left one comment about the purging, otherwise it looks great. Thank you @gilacost!

😍

AWS_REGION: ${{ secrets.HEX_AWS_REGION }}
AWS_S3_BUCKET: ${{ secrets.HEX_AWS_S3_BUCKET }}
run: |
mv elixir-otp-${{ matrix.otp }}.zip elixir.zip
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gilacost and others added 2 commits November 17, 2022 21:32
@gilacost
Copy link
Contributor Author

I am trying to understand this with no luck 😅. Could you bring some light here @ericmj 🙏

@gilacost gilacost requested review from ericmj and josevalim and removed request for ericmj November 18, 2022 07:09
@gilacost gilacost requested review from ericmj and removed request for josevalim November 18, 2022 07:09
@ericmj
Copy link
Member

ericmj commented Nov 18, 2022

I am trying to understand this with no luck 😅. Could you bring some light here @ericmj 🙏

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
Copy link
Member

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.

@gilacost
Copy link
Contributor Author

Is there anything else that we need to do to get this merged? 😄 Please let me know if I can help in any way 😛

@gilacost gilacost requested a review from josevalim November 19, 2022 07:54
@josevalim josevalim merged commit b9bcfae into elixir-lang:main Nov 19, 2022
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Automate docs publishing to Hexdocs with GitHub Actions

3 participants