-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce vscode marketplace compatible versioning (#1189)
- Loading branch information
Showing
8 changed files
with
47 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# Retries a vscode marketplace compatible version number to be used by | ||
# vsce package && vsce publish. These require numeric only, X.Y.Z with ranges | ||
# between 0-2147483647. Package allows other version numbers but publish does | ||
# not. | ||
# | ||
# We used the build number in the past, but that would not allow use retrigger | ||
# a build and might cause problems when switching from a CI to another. Thus, | ||
# we opted for number of seconds passed between last tag and last commit. This | ||
# should generate 0 for tagged commits and other numbers for pull requests. | ||
set -Ee | ||
LAST_TAG=$(git describe --tags --abbrev=0) | ||
LAST_TAG_TIMESTAMP=$(git -P log -1 --format=%ct "${LAST_TAG}") | ||
LAST_COMMIT_TIMESTAMP=$(git -P show --no-patch --format=%ct HEAD) | ||
VERSION_SUFFIX="$((LAST_COMMIT_TIMESTAMP-LAST_TAG_TIMESTAMP))" | ||
# We remove the last number from the node reported version. | ||
VERSION_PREFIX=$(node -p "require('./package.json').version") | ||
echo -n "${VERSION_PREFIX%.*}.${VERSION_SUFFIX}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# (cspell: disable-next-line) | ||
set -Eeuo pipefail | ||
# ^ capital E needed as we want to fail for subshells too. | ||
rm -f ./*.vsix | ||
yarn run webpack | ||
VERSION="$(./tools/get-marketplace-version.sh)" | ||
vsce_package_args=(--no-dependencies --no-git-tag-version --no-update-package-json) | ||
if [[ "$VERSION" == *.0 ]]; then | ||
vsce_package_args+=("--pre-release") | ||
fi | ||
# --no-dependencies and --no-yarn needed due to https://github.com/microsoft/vscode-vsce/issues/439 | ||
yarn run vsce package "${vsce_package_args[@]}" "${VERSION}" | ||
# Using zipinfo instead of `npx vsce ls` due to https://github.com/microsoft/vscode-vsce/issues/517 | ||
zipinfo -1 ./*.vsix > out/log/package.log | ||
tools/dirty.sh | ||
echo "Generated ansible-${VERSION}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters