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

fix(brew): Replace version in artifact names with '__VERSION__' to access checksums from mustache #488

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,11 @@ contains the following variables:
- `version`: The new version
- `revision`: The tag's commit SHA
- `checksums`: A map containing sha256 checksums for every release asset. Use
the full filename to access the sha, e.g. `checksums.MyProgram-x86`
the full filename to access the sha, e.g. `checksums.MyProgram-x86`. If the
filename contains dots (`.`), they are being replaced with `__`. If the
filename contains the currently released version, it is replaced with `__VERSION__`.
For example, `sentry-wizard-v3.9.3.tgz` checksums will be accessible by the key
`checksums.sentry-wizard-v__VERSION____tgz`.

**Environment**

Expand Down
3 changes: 2 additions & 1 deletion src/targets/brew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ export class BrewTarget extends BaseTarget {
const checksums: any = {};

await mapLimit(filesList, MAX_DOWNLOAD_CONCURRENCY, async file => {
checksums[file.filename] = await this.artifactProvider.getChecksum(
const key = file.filename.replace(version, '__VERSION__');
checksums[key] = await this.artifactProvider.getChecksum(
file,
HashAlgorithm.SHA256,
HashOutputFormat.Hex
Expand Down
Loading