mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-05-17 14:44:46 +00:00
Create version-manifest.json on uv release (#399)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Release Drafter / ✏️ Draft release (push) Waiting to run
test / lint (push) Waiting to run
test / test-default-version (macos-14) (push) Waiting to run
test / test-default-version (macos-latest) (push) Waiting to run
test / test-default-version (ubuntu-latest) (push) Waiting to run
test / test-default-version (windows-latest) (push) Waiting to run
test / test-specific-version (0.3) (push) Waiting to run
test / test-specific-version (0.3.0) (push) Waiting to run
test / test-specific-version (0.3.2) (push) Waiting to run
test / test-specific-version (0.3.x) (push) Waiting to run
test / test-specific-version (>=0.3.0) (push) Waiting to run
test / test-semver-range (selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-semver-range (ubuntu-latest) (push) Waiting to run
test / test-pep440-version (push) Waiting to run
test / test-pyproject-file-version (push) Waiting to run
test / test-malformed-pyproject-file-fallback (push) Waiting to run
test / test-uv-file-version (push) Waiting to run
test / test-checksum (map[checksum:4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd os:ubuntu-latest]) (push) Waiting to run
test / test-checksum (map[checksum:a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218 os:macos-latest]) (push) Waiting to run
test / test-with-explicit-token (push) Waiting to run
test / test-uvx (push) Waiting to run
test / test-tool-install (macos-14) (push) Waiting to run
test / test-tool-install (macos-latest) (push) Waiting to run
test / test-tool-install (ubuntu-latest) (push) Waiting to run
test / test-tool-install (windows-latest) (push) Waiting to run
test / test-tilde-expansion-tool-dirs (push) Waiting to run
test / test-python-version (macos-latest) (push) Waiting to run
test / test-python-version (ubuntu-latest) (push) Waiting to run
test / test-python-version (windows-latest) (push) Waiting to run
test / test-activate-environment (macos-latest) (push) Waiting to run
test / test-activate-environment (ubuntu-latest) (push) Waiting to run
test / test-activate-environment (windows-latest) (push) Waiting to run
test / test-musl (push) Waiting to run
test / test-setup-cache (auto, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (auto, ubuntu-latest) (push) Waiting to run
test / test-setup-cache (auto, windows-latest) (push) Waiting to run
test / test-setup-cache (false, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (false, ubuntu-latest) (push) Waiting to run
test / test-setup-cache (false, windows-latest) (push) Waiting to run
test / test-setup-cache (true, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (true, ubuntu-latest) (push) Waiting to run
test / test-setup-cache (true, windows-latest) (push) Waiting to run
test / test-restore-cache (auto, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (auto, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (auto, windows-latest) (push) Blocked by required conditions
test / test-restore-cache (false, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (false, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (false, windows-latest) (push) Blocked by required conditions
test / test-restore-cache (true, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (true, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (true, windows-latest) (push) Blocked by required conditions
test / test-setup-cache-requirements-txt (push) Waiting to run
test / test-restore-cache-requirements-txt (push) Blocked by required conditions
test / test-setup-cache-dependency-glob (push) Waiting to run
test / test-restore-cache-dependency-glob (push) Blocked by required conditions
test / test-cache-local (map[expected-cache-dir:/home/runner/work/_temp/setup-uv-cache os:ubuntu-latest]) (push) Waiting to run
test / test-cache-local (map[expected-cache-dir:/home/ubuntu/.cache/uv os:selfhosted-ubuntu-arm64]) (push) Waiting to run
test / test-cache-local (map[expected-cache-dir:D:\a\_temp\setup-uv-cache os:windows-latest]) (push) Waiting to run
test / test-setup-cache-local (push) Waiting to run
test / test-restore-cache-local (push) Blocked by required conditions
test / test-tilde-expansion-cache-local-path (push) Waiting to run
test / test-tilde-expansion-cache-dependency-glob (push) Waiting to run
test / cleanup-tilde-expansion-tests (push) Blocked by required conditions
test / test-no-python-version (push) Waiting to run
test / all-tests-passed (push) Blocked by required conditions
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Release Drafter / ✏️ Draft release (push) Waiting to run
test / lint (push) Waiting to run
test / test-default-version (macos-14) (push) Waiting to run
test / test-default-version (macos-latest) (push) Waiting to run
test / test-default-version (ubuntu-latest) (push) Waiting to run
test / test-default-version (windows-latest) (push) Waiting to run
test / test-specific-version (0.3) (push) Waiting to run
test / test-specific-version (0.3.0) (push) Waiting to run
test / test-specific-version (0.3.2) (push) Waiting to run
test / test-specific-version (0.3.x) (push) Waiting to run
test / test-specific-version (>=0.3.0) (push) Waiting to run
test / test-semver-range (selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-semver-range (ubuntu-latest) (push) Waiting to run
test / test-pep440-version (push) Waiting to run
test / test-pyproject-file-version (push) Waiting to run
test / test-malformed-pyproject-file-fallback (push) Waiting to run
test / test-uv-file-version (push) Waiting to run
test / test-checksum (map[checksum:4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd os:ubuntu-latest]) (push) Waiting to run
test / test-checksum (map[checksum:a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218 os:macos-latest]) (push) Waiting to run
test / test-with-explicit-token (push) Waiting to run
test / test-uvx (push) Waiting to run
test / test-tool-install (macos-14) (push) Waiting to run
test / test-tool-install (macos-latest) (push) Waiting to run
test / test-tool-install (ubuntu-latest) (push) Waiting to run
test / test-tool-install (windows-latest) (push) Waiting to run
test / test-tilde-expansion-tool-dirs (push) Waiting to run
test / test-python-version (macos-latest) (push) Waiting to run
test / test-python-version (ubuntu-latest) (push) Waiting to run
test / test-python-version (windows-latest) (push) Waiting to run
test / test-activate-environment (macos-latest) (push) Waiting to run
test / test-activate-environment (ubuntu-latest) (push) Waiting to run
test / test-activate-environment (windows-latest) (push) Waiting to run
test / test-musl (push) Waiting to run
test / test-setup-cache (auto, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (auto, ubuntu-latest) (push) Waiting to run
test / test-setup-cache (auto, windows-latest) (push) Waiting to run
test / test-setup-cache (false, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (false, ubuntu-latest) (push) Waiting to run
test / test-setup-cache (false, windows-latest) (push) Waiting to run
test / test-setup-cache (true, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (true, ubuntu-latest) (push) Waiting to run
test / test-setup-cache (true, windows-latest) (push) Waiting to run
test / test-restore-cache (auto, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (auto, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (auto, windows-latest) (push) Blocked by required conditions
test / test-restore-cache (false, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (false, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (false, windows-latest) (push) Blocked by required conditions
test / test-restore-cache (true, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (true, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (true, windows-latest) (push) Blocked by required conditions
test / test-setup-cache-requirements-txt (push) Waiting to run
test / test-restore-cache-requirements-txt (push) Blocked by required conditions
test / test-setup-cache-dependency-glob (push) Waiting to run
test / test-restore-cache-dependency-glob (push) Blocked by required conditions
test / test-cache-local (map[expected-cache-dir:/home/runner/work/_temp/setup-uv-cache os:ubuntu-latest]) (push) Waiting to run
test / test-cache-local (map[expected-cache-dir:/home/ubuntu/.cache/uv os:selfhosted-ubuntu-arm64]) (push) Waiting to run
test / test-cache-local (map[expected-cache-dir:D:\a\_temp\setup-uv-cache os:windows-latest]) (push) Waiting to run
test / test-setup-cache-local (push) Waiting to run
test / test-restore-cache-local (push) Blocked by required conditions
test / test-tilde-expansion-cache-local-path (push) Waiting to run
test / test-tilde-expansion-cache-dependency-glob (push) Waiting to run
test / cleanup-tilde-expansion-tests (push) Blocked by required conditions
test / test-no-python-version (push) Waiting to run
test / all-tests-passed (push) Blocked by required conditions
This commit is contained in:
parent
023b8ec2bc
commit
a4f1f549e9
8 changed files with 20515 additions and 60 deletions
111
dist/update-known-checksums/index.js → dist/update-known-versions/index.js
generated
vendored
111
dist/update-known-checksums/index.js → dist/update-known-versions/index.js
generated
vendored
|
@ -61824,7 +61824,84 @@ async function downloadAssetContent(downloadUrl) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5653:
|
||||
/***/ 4000:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getLatestKnownVersion = getLatestKnownVersion;
|
||||
exports.updateVersionManifest = updateVersionManifest;
|
||||
const node_fs_1 = __nccwpck_require__(3024);
|
||||
const core = __importStar(__nccwpck_require__(7484));
|
||||
const semver = __importStar(__nccwpck_require__(9318));
|
||||
async function getLatestKnownVersion(versionManifestFile) {
|
||||
const data = await node_fs_1.promises.readFile(versionManifestFile);
|
||||
const versionManifestEntries = JSON.parse(data.toString());
|
||||
return versionManifestEntries.reduce((a, b) => semver.gt(a.version, b.version) ? a : b).version;
|
||||
}
|
||||
async function updateVersionManifest(versionManifestFile, downloadUrls) {
|
||||
const versionManifest = [];
|
||||
for (const downloadUrl of downloadUrls) {
|
||||
const urlParts = downloadUrl.split("/");
|
||||
const version = urlParts[urlParts.length - 2];
|
||||
const artifactName = urlParts[urlParts.length - 1];
|
||||
if (!artifactName.startsWith("uv-")) {
|
||||
continue;
|
||||
}
|
||||
if (artifactName.startsWith("uv-installer")) {
|
||||
continue;
|
||||
}
|
||||
const artifactParts = artifactName.split(".")[0].split("-");
|
||||
versionManifest.push({
|
||||
version: version,
|
||||
artifactName: artifactName,
|
||||
arch: artifactParts[1],
|
||||
platform: artifactName.split(`uv-${artifactParts[1]}-`)[1].split(".")[0],
|
||||
downloadUrl: downloadUrl,
|
||||
});
|
||||
}
|
||||
core.debug(`Updating version manifest: ${JSON.stringify(versionManifest)}`);
|
||||
await node_fs_1.promises.writeFile(versionManifestFile, JSON.stringify(versionManifest));
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7416:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -61868,24 +61945,36 @@ const core = __importStar(__nccwpck_require__(7484));
|
|||
const octokit_1 = __nccwpck_require__(3352);
|
||||
const constants_1 = __nccwpck_require__(6156);
|
||||
const update_known_checksums_1 = __nccwpck_require__(6182);
|
||||
const version_manifest_1 = __nccwpck_require__(4000);
|
||||
async function run() {
|
||||
const checksumFilePath = process.argv.slice(2)[0];
|
||||
const github_token = process.argv.slice(2)[1];
|
||||
const versionsManifestFilePath = process.argv.slice(2)[1];
|
||||
const githubToken = process.argv.slice(2)[2];
|
||||
const octokit = new octokit_1.Octokit({
|
||||
auth: github_token,
|
||||
auth: githubToken,
|
||||
});
|
||||
const response = await octokit.paginate(octokit.rest.repos.listReleases, {
|
||||
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({
|
||||
owner: constants_1.OWNER,
|
||||
repo: constants_1.REPO,
|
||||
});
|
||||
const downloadUrls = response.flatMap((release) => release.assets
|
||||
const latestKnownVersion = await (0, version_manifest_1.getLatestKnownVersion)(versionsManifestFilePath);
|
||||
if (semver.lte(latestRelease.tag_name, latestKnownVersion)) {
|
||||
core.info(`Latest release (${latestRelease.tag_name}) is not newer than the latest known version (${latestKnownVersion}). Skipping update.`);
|
||||
return;
|
||||
}
|
||||
const releases = await octokit.paginate(octokit.rest.repos.listReleases, {
|
||||
owner: constants_1.OWNER,
|
||||
repo: constants_1.REPO,
|
||||
});
|
||||
const checksumDownloadUrls = releases.flatMap((release) => release.assets
|
||||
.filter((asset) => asset.name.endsWith(".sha256"))
|
||||
.map((asset) => asset.browser_download_url));
|
||||
await (0, update_known_checksums_1.updateChecksums)(checksumFilePath, downloadUrls);
|
||||
const latestVersion = response
|
||||
.map((release) => release.tag_name)
|
||||
.sort(semver.rcompare)[0];
|
||||
core.setOutput("latest-version", latestVersion);
|
||||
await (0, update_known_checksums_1.updateChecksums)(checksumFilePath, checksumDownloadUrls);
|
||||
const artifactDownloadUrls = releases.flatMap((release) => release.assets
|
||||
.filter((asset) => !asset.name.endsWith(".sha256"))
|
||||
.map((asset) => asset.browser_download_url));
|
||||
await (0, version_manifest_1.updateVersionManifest)(versionsManifestFilePath, artifactDownloadUrls);
|
||||
core.setOutput("latest-version", latestRelease.tag_name);
|
||||
}
|
||||
run();
|
||||
|
||||
|
@ -67976,7 +68065,7 @@ legacyRestEndpointMethods.VERSION = VERSION;
|
|||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(5653);
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(7416);
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
||||
/******/ })()
|
Loading…
Add table
Add a link
Reference in a new issue