Skip to content

The asset release/my-project-v4.1.0*.zip cannot be read, and will be ignored.Β #867

@erakis

Description

@erakis

The name of the file that serves as an asset for the release has a name with the channel included, except that it is dynamic and created by a powershell script.

Part of my config

    [
      "@semantic-release/exec",
      {
        prepareCmd: "node scripts/update-version-header.js ${nextRelease.version}",
        publishCmd:
          "pwsh -File scripts/build-and-release.ps1" +
          " -buildChannel \"${nextRelease.channel}\"" +
          " -releaseVersion \"${nextRelease.version}\"" +
          ` -buildId ${process.env.CI_PIPELINE_ID || 0}`
      }
    ],
    // ...
    [
      "@semantic-release/gitlab",
      {
        gitlabUrl: "https://gitlab.intelia.com",
        assets: [
          "release/my-project-v${nextRelease.version}*.zip"
        ],
      }
    ],

In the file build-and-release.psl there's a function to create the zip archive filename adding the channel.

function Get-ZipFileName {
    $hasBuildChannel = -not [string]::IsNullOrEmpty($buildChannel)
    $channelSuffix = if ($hasBuildChannel) {
        "-$buildChannel"
    } else {
        ""
    }
    return "my-project-v$releaseVersion$channelSuffix.zip"
}

This may produce one of these file names

  • release/my-project-v4.1.0.zip
  • release/my-project-v4.1.0-alpha.zip
  • release/my-project-v4.1.0-beta.zip

I confirm that the file actually exists in the directory and this when the script scripts/build-and-release.ps1 ends.

I don't understand, yet the file release/my-project-v4.1.0.zip exists, so why doesn't the glob in the assets release/my-project-v4.1.0*.zip see it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions