Ensure release keyword can be used in with runner shell executors on Windows
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
We need to investigate if it's possible to use the release keyword from .gitlab-ci.yaml runner shell executors on Windows. This is possible to do on unix-like runner shell executors by installing the release-cli manually as shown in release-cli#53 (closed)
Steps to reproduce
Add a release step to a .gitlab-ci.yml configuration and install the release-cli manually
release-windows-using-binary:
stage: release
variables:
# To be replaced by generic package registry URL in the future https://gitlab.com/gitlab-org/release-cli/-/issues/83
RELEASE_CLI_DOWNLOAD_URL: https://release-cli-downloads.s3.amazonaws.com/latest/release-cli-windows-amd64.exe
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created manually
script:
- mkdir release-cli
- choco install -r --no-progress curl -y
- curl.exe -L "$RELEASE_CLI_DOWNLOAD_URL" --output release-cli\release-cli.exe
- set cliDir=%cd%\release-cli
- '$env:Path += ";%cliDir%"'
- echo %cliDir%
- release-cli -h
- echo "running release from $CI_COMMIT_TAG"
release:
name: "Release $CI_COMMIT_TAG"
description: 'CHANGELOG.md'
tag_name: '$CI_COMMIT_TAG'
An error occurs when release-cli is not found
release-cli : The term 'release-cli' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
Example Project
What is the current bug behavior?
Using the release keyword on a Windows shell executor cannot find the release-cli
What is the expected correct behavior?
The release script should be able to find the release-cli executable.
Relevant logs and/or screenshots
Failing job https://gitlab.com/jaime/hello/-/jobs/985900837
Output of checks
This bug happens on GitLab.com
Possible fixes
- Perhaps we need to identify the running platform when we parse the
releasescript to call therelease-cli.exe(with an extension). - It could also be a matter of adding the
release-clito the Windows Path.
Edited by 🤖 GitLab Bot 🤖