Skip to content

Commit

Permalink
fix(brew): Replace version in artifact names with 'latest' to access …
Browse files Browse the repository at this point in the history
…checksums from mustache
  • Loading branch information
romtsn committed Aug 28, 2023
1 parent d4c12da commit 834af3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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 `latest`.
For example, `sentry-wizard-3.9.3.tgz` checksums will be accessible by the key
`checksums.sentry-wizard-latest__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, 'latest');
checksums[key] = await this.artifactProvider.getChecksum(
file,
HashAlgorithm.SHA256,
HashOutputFormat.Hex
Expand Down

0 comments on commit 834af3a

Please sign in to comment.