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

build: upload checksums file #552

Merged
merged 2 commits into from
Apr 13, 2022
Merged

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Apr 12, 2022

For the configlet 4.0.0-alpha.37 release, this file would contain:

64e801c83569759a0f877791fe0138fecbb3386eeb7167fd25a5e8f9624dda49  configlet-linux-64bit.tgz
6ad208cd881c048e42146dfc183cf4772b3ce4609460062b3ff4c67d856df81d  configlet-mac-64bit.tgz
48c521bb514ea8af2bb91c1129e68c9e90dfa2218b732ddce5c34372a99013b1  configlet-windows-64bit.zip

A user can download the checksum file and a release archive, and then
verify the archive was downloaded correctly. For example, on Linux:

$ sha256sum --check --ignore-missing configlet_4.0.0-alpha.37_checksums_sha256.txt
configlet-linux-64bit.tgz: OK

In the future, we can consider signing this file (see #548).

Closes: #457


Tested on my fork (triggered by pushing a tag named build-upload-checksums.3 to my fork):

Verifying by downloading the assets:

$ gh -R ee7/configlet release download build-upload-checksums.3 -D /tmp/ee7configletchecksums
$ cd /tmp/ee7configletchecksums
$ cat configlet_build-upload-checksums.3_checksums_sha256.txt
ce87c87c1b161a3b7f44576939589ed8b05a91b44ce911839aa27bfd3ff5c2a4  configlet-linux-64bit.tgz
7b9ed4806a322c24bc435092dfa36e2057af78379e1839313a5a957441b6f86c  configlet-mac-64bit.tgz
6ed7eee8efc31cd1bffe4db571acb5df502b250f575c301f17bbef4aa2257092  configlet-windows-64bit.zip
$ sha256sum -c configlet_build-upload-checksums.3_checksums_sha256.txt
configlet-linux-64bit.tgz: OK
configlet-mac-64bit.tgz: OK
configlet-windows-64bit.zip: OK

For the 4.0.0-alpha.37 release, this file would contain:

    64e801c83569759a0f877791fe0138fecbb3386eeb7167fd25a5e8f9624dda49  configlet-linux-64bit.tgz
    6ad208cd881c048e42146dfc183cf4772b3ce4609460062b3ff4c67d856df81d  configlet-mac-64bit.tgz
    48c521bb514ea8af2bb91c1129e68c9e90dfa2218b732ddce5c34372a99013b1  configlet-windows-64bit.zip

A user can download the checksum file and a release archive, and then
verify the archive was downloaded correctly. For example, on Linux:

    $ sha256sum --check --ignore-missing configlet_4.0.0-alpha.37_checksums_sha256.txt
    configlet-linux-64bit.tgz: OK
I didn't need this in my initial implementation, because I was uploading
in `publish-release` conditionally (without a dependent job).

# Write checksums file
cd "${download_dir}" || exit
checksums_file="configlet_${build_tag}_checksums_sha256.txt"
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm using underscores here (despite the current naming convention using hyphens) because:

  • We need to change the naming convention in the future to support extra platforms.
  • Semantic versioning allows only hyphens for naming prerelease versions, and using underscores everywhere else helps indicate that.
  • I think it's more readable.

One project that uses underscores for release assets is https://github.com/cli/cli/releases

See #363.

Copy link
Member

Choose a reason for hiding this comment

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

Those seem like reasonable arguments.


# Write checksums file
cd "${download_dir}" || exit
checksums_file="configlet_${build_tag}_checksums_sha256.txt"
Copy link
Member

Choose a reason for hiding this comment

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

Those seem like reasonable arguments.

@ee7 ee7 merged commit f7c1225 into exercism:main Apr 13, 2022
@ee7 ee7 deleted the build-upload-checksums-file branch April 13, 2022 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build: consider adding asset that contains checksums
2 participants