5
0
mirror of https://github.com/astral-sh/setup-uv.git synced 2025-12-17 11:05:59 +00:00

Compare commits

..

10 Commits

Author SHA1 Message Date
Kevin Stillhammer
b463f5b8ca rename utils/utils.ts to constants.ts (#59) 2024-09-07 12:13:50 +00:00
Kevin Stillhammer
417c97acee Use D:\a\_tmp\setup-uv-cache as default cacheLocalPath on Windows (#57)
Fixes: #52
2024-09-07 14:11:25 +02:00
github-actions[bot]
4beb0eca42 chore: update known checksums for 0.4.7 (#58)
chore: update known checksums for 0.4.7

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-09-07 09:47:36 +00:00
dependabot[bot]
428055c3da Bump peter-evans/create-pull-request from 7.0.0 to 7.0.1 (#56)
Bumps
[peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request)
from 7.0.0 to 7.0.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/peter-evans/create-pull-request/releases">peter-evans/create-pull-request's
releases</a>.</em></p>
<blockquote>
<h2>Create Pull Request v7.0.1</h2>
<p>⚙️ Fixes <a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3311">an
issue</a> affecting one particular use case where the action fails on
<code>diff --stat</code> with <code>fatal: ambiguous
argument</code>.</p>
<h2>What's Changed</h2>
<ul>
<li>build(deps): bump peter-evans/create-pull-request from 6 to 7 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3283">peter-evans/create-pull-request#3283</a></li>
<li>build(deps-dev): bump <code>@​types/node</code> from 18.19.46 to
18.19.48 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3288">peter-evans/create-pull-request#3288</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/parser</code> from
7.17.0 to 7.18.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3289">peter-evans/create-pull-request#3289</a></li>
<li>build(deps-dev): bump eslint-plugin-import from 2.29.1 to 2.30.0 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3290">peter-evans/create-pull-request#3290</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 7.17.0 to 7.18.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3291">peter-evans/create-pull-request#3291</a></li>
<li>fix: handle ambiguous argument failure on diff stat by <a
href="https://github.com/peter-evans"><code>@​peter-evans</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3312">peter-evans/create-pull-request#3312</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/peter-evans/create-pull-request/compare/v7.0.0...v7.0.1">https://github.com/peter-evans/create-pull-request/compare/v7.0.0...v7.0.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8867c4aba1"><code>8867c4a</code></a>
fix: handle ambiguous argument failure on diff stat (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3312">#3312</a>)</li>
<li><a
href="6073f5434b"><code>6073f54</code></a>
build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code> (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3291">#3291</a>)</li>
<li><a
href="6d01b5601c"><code>6d01b56</code></a>
build(deps-dev): bump eslint-plugin-import from 2.29.1 to 2.30.0 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3290">#3290</a>)</li>
<li><a
href="25cf8451c3"><code>25cf845</code></a>
build(deps-dev): bump <code>@​typescript-eslint/parser</code> from
7.17.0 to 7.18.0 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3289">#3289</a>)</li>
<li><a
href="d87b980a0e"><code>d87b980</code></a>
build(deps-dev): bump <code>@​types/node</code> from 18.19.46 to
18.19.48 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3288">#3288</a>)</li>
<li><a
href="119d131ea9"><code>119d131</code></a>
build(deps): bump peter-evans/create-pull-request from 6 to 7 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3283">#3283</a>)</li>
<li><a
href="73e6230af4"><code>73e6230</code></a>
docs: update readme</li>
<li><a
href="c0348e860f"><code>c0348e8</code></a>
ci: add v7 to workflow</li>
<li>See full diff in <a
href="4320041ed3...8867c4aba1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=peter-evans/create-pull-request&package-manager=github_actions&previous-version=7.0.0&new-version=7.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-06 14:47:10 +02:00
Hynek Schlawack
20d812c7a3 Update README to v2 (#50) 2024-09-06 14:46:33 +02:00
Kevin Stillhammer
d9a2b6b6fa Support a list of cache-dependency-glob (#41)
Closes: #40

Because of build conflics (forgot to run `npm i` after pulling) I
deleted the `dist`folder to start fresh. Turns out that it still
contained the source maps from the very first commit. I removed the
argument to generate those a long time ago
2024-09-06 14:44:31 +02:00
github-actions[bot]
606b0d67da chore: update known checksums for 0.4.6 (#55)
chore: update known checksums for 0.4.6

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-09-06 13:31:10 +02:00
Kevin Stillhammer
67736b0f01 Always run check-dist check (#53)
Currently we mark it as a required check and thus prevent automatic PR
merges when only markdown files are contained in the PR
2024-09-06 13:07:34 +02:00
github-actions[bot]
fc672aa0a3 chore: update known checksums for 0.4.5 (#48)
chore: update known checksums for 0.4.5

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-09-06 09:30:10 +02:00
Kevin Stillhammer
79643936e1 Run test build only on ubuntu-latest (#51)
It is unnecessary to test this on several OS. This is done by the actual
action tests in other jobs.
2024-09-06 09:19:26 +02:00
29 changed files with 323 additions and 71412 deletions

View File

@@ -9,11 +9,7 @@ on:
push: push:
branches: branches:
- main - main
paths-ignore:
- "**.md"
pull_request: pull_request:
paths-ignore:
- "**.md"
workflow_dispatch: workflow_dispatch:
jobs: jobs:

View File

@@ -48,6 +48,46 @@ jobs:
- run: uv sync - run: uv sync
working-directory: __tests__/fixtures/uv-project working-directory: __tests__/fixtures/uv-project
test-setup-cache-dependency-glob:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup with cache
uses: ./
with:
enable-cache: true
cache-dependency-glob: |
__tests__/fixtures/uv-project/uv.lock
**/pyproject.toml
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-restore-cache-dependency-glob:
runs-on: ubuntu-latest
needs: test-setup-cache-dependency-glob
steps:
- uses: actions/checkout@v4
- name: Change pyproject.toml
run: |
echo '[tool.uv]' >> __tests__/fixtures/uv-project/pyproject.toml
echo 'dev-dependencies = []' >> __tests__/fixtures/uv-project/pyproject.toml
- name: Restore with cache
id: restore
uses: ./
with:
enable-cache: true
cache-dependency-glob: |
__tests__/fixtures/uv-project/uv.lock
**/pyproject.toml
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}
- name: Cache was not hit
run: |
if [ "$CACHE_HIT" == "true" ]; then
exit 1
fi
env:
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
test-setup-cache-local: test-setup-cache-local:
runs-on: oracle-aarch64 runs-on: oracle-aarch64
steps: steps:

View File

@@ -11,10 +11,7 @@ concurrency:
jobs: jobs:
build: build:
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14, oracle-aarch64]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
@@ -81,7 +78,6 @@ jobs:
uses: ./ uses: ./
- run: uv sync - run: uv sync
working-directory: __tests__/fixtures/uv-project working-directory: __tests__/fixtures/uv-project
test-uvx: test-uvx:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@@ -17,7 +17,7 @@ jobs:
src/download/checksum/known-checksums.ts ${{ secrets.GITHUB_TOKEN }} src/download/checksum/known-checksums.ts ${{ secrets.GITHUB_TOKEN }}
- run: npm install && npm run all - run: npm install && npm run all
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # v7.0.0 uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7.0.1
with: with:
commit-message: "chore: update known checksums" commit-message: "chore: update known checksums"
title: title:

View File

@@ -27,7 +27,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
```yaml ```yaml
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
version: "latest" version: "latest"
``` ```
@@ -45,7 +45,7 @@ For an example workflow, see
```yaml ```yaml
- name: Install a specific version of uv - name: Install a specific version of uv
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
version: "0.4.4" version: "0.4.4"
``` ```
@@ -58,7 +58,7 @@ are automatically verified by this action. The sha265 hashes can be found on the
```yaml ```yaml
- name: Install a specific version and validate the checksum - name: Install a specific version and validate the checksum
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
version: "0.3.1" version: "0.3.1"
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8" checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
@@ -75,7 +75,7 @@ You can optionally define a custom cache key suffix.
```yaml ```yaml
- name: Enable caching and define a custom cache key suffix - name: Enable caching and define a custom cache key suffix
id: setup-uv id: setup-uv
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
enable-cache: true enable-cache: true
cache-suffix: "optional-suffix" cache-suffix: "optional-suffix"
@@ -97,7 +97,7 @@ specify the path with the `cache-local-path` input.
```yaml ```yaml
- name: Define a custom uv cache path - name: Define a custom uv cache path
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
enable-cache: true enable-cache: true
cache-local-path: "/path/to/cache" cache-local-path: "/path/to/cache"
@@ -111,7 +111,7 @@ changes. The glob matches files relative to the repository root.
```yaml ```yaml
- name: Define a cache dependency glob - name: Define a cache dependency glob
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: "uv.lock" cache-dependency-glob: "uv.lock"
@@ -119,12 +119,22 @@ changes. The glob matches files relative to the repository root.
```yaml ```yaml
- name: Define a cache dependency glob - name: Define a cache dependency glob
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: "**requirements*.txt" cache-dependency-glob: "**requirements*.txt"
``` ```
```yaml
- name: Define a list of cache dependency globs
uses: astral-sh/setup-uv@v1
with:
enable-cache: true
cache-dependency-glob: |
'**requirements*.txt'
'**pyproject.toml'
```
### API rate limit ### API rate limit
To avoid hitting the `API rate limit exceeded` error, supply a GitHub token via the `github-token` To avoid hitting the `API rate limit exceeded` error, supply a GitHub token via the `github-token`
@@ -132,7 +142,7 @@ input.
```yaml ```yaml
- name: Install uv and supply a GitHub token - name: Install uv and supply a GitHub token
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
``` ```
@@ -161,7 +171,7 @@ For example:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@main uses: actions/checkout@main
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
enable-cache: true enable-cache: true
- name: Test - name: Test
@@ -173,7 +183,7 @@ To install a specific version of Python, use
```yaml ```yaml
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
with: with:
enable-cache: true enable-cache: true
- name: Install Python 3.12 - name: Install Python 3.12
@@ -192,7 +202,7 @@ output:
uses: actions/checkout@main uses: actions/checkout@main
- name: Install the default version of uv - name: Install the default version of uv
id: setup-uv id: setup-uv
uses: astral-sh/setup-uv@v1 uses: astral-sh/setup-uv@v2
- name: Print the installed version - name: Print the installed version
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
``` ```

View File

@@ -26,7 +26,7 @@ inputs:
required: false required: false
cache-local-path: cache-local-path:
description: "Local path to store the cache." description: "Local path to store the cache."
default: "/tmp/setup-uv-cache" default: ""
outputs: outputs:
uv-version: uv-version:
description: "The installed uv version. Useful when using latest." description: "The installed uv version. Useful when using latest."

29
dist/save-cache/index.js generated vendored
View File

@@ -82825,16 +82825,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.STATE_CACHE_MATCHED_KEY = exports.STATE_CACHE_KEY = void 0; exports.STATE_CACHE_MATCHED_KEY = exports.STATE_CACHE_KEY = void 0;
exports.restoreCache = restoreCache; exports.restoreCache = restoreCache;
const cache = __importStar(__nccwpck_require__(7799)); const cache = __importStar(__nccwpck_require__(7799));
const glob = __importStar(__nccwpck_require__(8090)); const glob = __importStar(__nccwpck_require__(8090));
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const path_1 = __importDefault(__nccwpck_require__(1017));
const inputs_1 = __nccwpck_require__(9378); const inputs_1 = __nccwpck_require__(9378);
const platforms_1 = __nccwpck_require__(6005); const platforms_1 = __nccwpck_require__(6005);
exports.STATE_CACHE_KEY = "cache-key"; exports.STATE_CACHE_KEY = "cache-key";
@@ -82862,10 +82858,10 @@ function computeKeys(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let cacheDependencyPathHash = "-"; let cacheDependencyPathHash = "-";
if (inputs_1.cacheDependencyGlob !== "") { if (inputs_1.cacheDependencyGlob !== "") {
const fullCacheDependencyGlob = `${process.env["GITHUB_WORKSPACE"]}${path_1.default.sep}${inputs_1.cacheDependencyGlob}`; core.info(`Searching files using cache dependency glob: ${inputs_1.cacheDependencyGlob.split("\n").join(",")}`);
cacheDependencyPathHash += yield glob.hashFiles(fullCacheDependencyGlob); cacheDependencyPathHash += yield glob.hashFiles(inputs_1.cacheDependencyGlob, undefined, undefined, true);
if (cacheDependencyPathHash === "-") { if (cacheDependencyPathHash === "-") {
throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob}], make sure you have checked out the target repository`); throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository`);
} }
} }
else { else {
@@ -83008,16 +83004,33 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.cacheDependencyGlob = exports.githubToken = exports.cacheLocalPath = exports.cacheSuffix = exports.enableCache = exports.checkSum = exports.version = void 0; exports.cacheDependencyGlob = exports.githubToken = exports.cacheLocalPath = exports.cacheSuffix = exports.enableCache = exports.checkSum = exports.version = void 0;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const path_1 = __importDefault(__nccwpck_require__(1017));
exports.version = core.getInput("version"); exports.version = core.getInput("version");
exports.checkSum = core.getInput("checksum"); exports.checkSum = core.getInput("checksum");
exports.enableCache = core.getInput("enable-cache") === "true"; exports.enableCache = core.getInput("enable-cache") === "true";
exports.cacheSuffix = core.getInput("cache-suffix") || ""; exports.cacheSuffix = core.getInput("cache-suffix") || "";
exports.cacheLocalPath = core.getInput("cache-local-path"); exports.cacheLocalPath = getCacheLocalPath();
exports.githubToken = core.getInput("github-token"); exports.githubToken = core.getInput("github-token");
exports.cacheDependencyGlob = core.getInput("cache-dependency-glob"); exports.cacheDependencyGlob = core.getInput("cache-dependency-glob");
function getCacheLocalPath() {
const cacheLocalPathInput = core.getInput("cache-local-path");
if (cacheLocalPathInput !== "") {
return cacheLocalPathInput;
}
if (process.env.RUNNER_TEMP !== undefined) {
return `${process.env.RUNNER_TEMP}${path_1.default.sep}setup-uv-cache`;
}
if (process.platform === "win32") {
return "D:\\a\\_temp\\setup-uv-cache";
}
return "/tmp/setup-uv-cache";
}
/***/ }), /***/ }),

1
dist/save-cache/index.js.map generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

453
dist/setup/37.index.js generated vendored
View File

@@ -1,453 +0,0 @@
"use strict";
exports.id = 37;
exports.ids = [37];
exports.modules = {
/***/ 4037:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "toFormData": () => (/* binding */ toFormData)
/* harmony export */ });
/* harmony import */ var fetch_blob_from_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2777);
/* harmony import */ var formdata_polyfill_esm_min_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8010);
let s = 0;
const S = {
START_BOUNDARY: s++,
HEADER_FIELD_START: s++,
HEADER_FIELD: s++,
HEADER_VALUE_START: s++,
HEADER_VALUE: s++,
HEADER_VALUE_ALMOST_DONE: s++,
HEADERS_ALMOST_DONE: s++,
PART_DATA_START: s++,
PART_DATA: s++,
END: s++
};
let f = 1;
const F = {
PART_BOUNDARY: f,
LAST_BOUNDARY: f *= 2
};
const LF = 10;
const CR = 13;
const SPACE = 32;
const HYPHEN = 45;
const COLON = 58;
const A = 97;
const Z = 122;
const lower = c => c | 0x20;
const noop = () => {};
class MultipartParser {
/**
* @param {string} boundary
*/
constructor(boundary) {
this.index = 0;
this.flags = 0;
this.onHeaderEnd = noop;
this.onHeaderField = noop;
this.onHeadersEnd = noop;
this.onHeaderValue = noop;
this.onPartBegin = noop;
this.onPartData = noop;
this.onPartEnd = noop;
this.boundaryChars = {};
boundary = '\r\n--' + boundary;
const ui8a = new Uint8Array(boundary.length);
for (let i = 0; i < boundary.length; i++) {
ui8a[i] = boundary.charCodeAt(i);
this.boundaryChars[ui8a[i]] = true;
}
this.boundary = ui8a;
this.lookbehind = new Uint8Array(this.boundary.length + 8);
this.state = S.START_BOUNDARY;
}
/**
* @param {Uint8Array} data
*/
write(data) {
let i = 0;
const length_ = data.length;
let previousIndex = this.index;
let {lookbehind, boundary, boundaryChars, index, state, flags} = this;
const boundaryLength = this.boundary.length;
const boundaryEnd = boundaryLength - 1;
const bufferLength = data.length;
let c;
let cl;
const mark = name => {
this[name + 'Mark'] = i;
};
const clear = name => {
delete this[name + 'Mark'];
};
const callback = (callbackSymbol, start, end, ui8a) => {
if (start === undefined || start !== end) {
this[callbackSymbol](ui8a && ui8a.subarray(start, end));
}
};
const dataCallback = (name, clear) => {
const markSymbol = name + 'Mark';
if (!(markSymbol in this)) {
return;
}
if (clear) {
callback(name, this[markSymbol], i, data);
delete this[markSymbol];
} else {
callback(name, this[markSymbol], data.length, data);
this[markSymbol] = 0;
}
};
for (i = 0; i < length_; i++) {
c = data[i];
switch (state) {
case S.START_BOUNDARY:
if (index === boundary.length - 2) {
if (c === HYPHEN) {
flags |= F.LAST_BOUNDARY;
} else if (c !== CR) {
return;
}
index++;
break;
} else if (index - 1 === boundary.length - 2) {
if (flags & F.LAST_BOUNDARY && c === HYPHEN) {
state = S.END;
flags = 0;
} else if (!(flags & F.LAST_BOUNDARY) && c === LF) {
index = 0;
callback('onPartBegin');
state = S.HEADER_FIELD_START;
} else {
return;
}
break;
}
if (c !== boundary[index + 2]) {
index = -2;
}
if (c === boundary[index + 2]) {
index++;
}
break;
case S.HEADER_FIELD_START:
state = S.HEADER_FIELD;
mark('onHeaderField');
index = 0;
// falls through
case S.HEADER_FIELD:
if (c === CR) {
clear('onHeaderField');
state = S.HEADERS_ALMOST_DONE;
break;
}
index++;
if (c === HYPHEN) {
break;
}
if (c === COLON) {
if (index === 1) {
// empty header field
return;
}
dataCallback('onHeaderField', true);
state = S.HEADER_VALUE_START;
break;
}
cl = lower(c);
if (cl < A || cl > Z) {
return;
}
break;
case S.HEADER_VALUE_START:
if (c === SPACE) {
break;
}
mark('onHeaderValue');
state = S.HEADER_VALUE;
// falls through
case S.HEADER_VALUE:
if (c === CR) {
dataCallback('onHeaderValue', true);
callback('onHeaderEnd');
state = S.HEADER_VALUE_ALMOST_DONE;
}
break;
case S.HEADER_VALUE_ALMOST_DONE:
if (c !== LF) {
return;
}
state = S.HEADER_FIELD_START;
break;
case S.HEADERS_ALMOST_DONE:
if (c !== LF) {
return;
}
callback('onHeadersEnd');
state = S.PART_DATA_START;
break;
case S.PART_DATA_START:
state = S.PART_DATA;
mark('onPartData');
// falls through
case S.PART_DATA:
previousIndex = index;
if (index === 0) {
// boyer-moore derrived algorithm to safely skip non-boundary data
i += boundaryEnd;
while (i < bufferLength && !(data[i] in boundaryChars)) {
i += boundaryLength;
}
i -= boundaryEnd;
c = data[i];
}
if (index < boundary.length) {
if (boundary[index] === c) {
if (index === 0) {
dataCallback('onPartData', true);
}
index++;
} else {
index = 0;
}
} else if (index === boundary.length) {
index++;
if (c === CR) {
// CR = part boundary
flags |= F.PART_BOUNDARY;
} else if (c === HYPHEN) {
// HYPHEN = end boundary
flags |= F.LAST_BOUNDARY;
} else {
index = 0;
}
} else if (index - 1 === boundary.length) {
if (flags & F.PART_BOUNDARY) {
index = 0;
if (c === LF) {
// unset the PART_BOUNDARY flag
flags &= ~F.PART_BOUNDARY;
callback('onPartEnd');
callback('onPartBegin');
state = S.HEADER_FIELD_START;
break;
}
} else if (flags & F.LAST_BOUNDARY) {
if (c === HYPHEN) {
callback('onPartEnd');
state = S.END;
flags = 0;
} else {
index = 0;
}
} else {
index = 0;
}
}
if (index > 0) {
// when matching a possible boundary, keep a lookbehind reference
// in case it turns out to be a false lead
lookbehind[index - 1] = c;
} else if (previousIndex > 0) {
// if our boundary turned out to be rubbish, the captured lookbehind
// belongs to partData
const _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);
callback('onPartData', 0, previousIndex, _lookbehind);
previousIndex = 0;
mark('onPartData');
// reconsider the current character even so it interrupted the sequence
// it could be the beginning of a new sequence
i--;
}
break;
case S.END:
break;
default:
throw new Error(`Unexpected state entered: ${state}`);
}
}
dataCallback('onHeaderField');
dataCallback('onHeaderValue');
dataCallback('onPartData');
// Update properties for the next call
this.index = index;
this.state = state;
this.flags = flags;
}
end() {
if ((this.state === S.HEADER_FIELD_START && this.index === 0) ||
(this.state === S.PART_DATA && this.index === this.boundary.length)) {
this.onPartEnd();
} else if (this.state !== S.END) {
throw new Error('MultipartParser.end(): stream ended unexpectedly');
}
}
}
function _fileName(headerValue) {
// matches either a quoted-string or a token (RFC 2616 section 19.5.1)
const m = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
if (!m) {
return;
}
const match = m[2] || m[3] || '';
let filename = match.slice(match.lastIndexOf('\\') + 1);
filename = filename.replace(/%22/g, '"');
filename = filename.replace(/&#(\d{4});/g, (m, code) => {
return String.fromCharCode(code);
});
return filename;
}
async function toFormData(Body, ct) {
if (!/multipart/i.test(ct)) {
throw new TypeError('Failed to fetch');
}
const m = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
if (!m) {
throw new TypeError('no or bad content-type header, no multipart boundary');
}
const parser = new MultipartParser(m[1] || m[2]);
let headerField;
let headerValue;
let entryValue;
let entryName;
let contentType;
let filename;
const entryChunks = [];
const formData = new formdata_polyfill_esm_min_js__WEBPACK_IMPORTED_MODULE_1__/* .FormData */ .Ct();
const onPartData = ui8a => {
entryValue += decoder.decode(ui8a, {stream: true});
};
const appendToFile = ui8a => {
entryChunks.push(ui8a);
};
const appendFileToFormData = () => {
const file = new fetch_blob_from_js__WEBPACK_IMPORTED_MODULE_0__/* .File */ .$B(entryChunks, filename, {type: contentType});
formData.append(entryName, file);
};
const appendEntryToFormData = () => {
formData.append(entryName, entryValue);
};
const decoder = new TextDecoder('utf-8');
decoder.decode();
parser.onPartBegin = function () {
parser.onPartData = onPartData;
parser.onPartEnd = appendEntryToFormData;
headerField = '';
headerValue = '';
entryValue = '';
entryName = '';
contentType = '';
filename = null;
entryChunks.length = 0;
};
parser.onHeaderField = function (ui8a) {
headerField += decoder.decode(ui8a, {stream: true});
};
parser.onHeaderValue = function (ui8a) {
headerValue += decoder.decode(ui8a, {stream: true});
};
parser.onHeaderEnd = function () {
headerValue += decoder.decode();
headerField = headerField.toLowerCase();
if (headerField === 'content-disposition') {
// matches either a quoted-string or a token (RFC 2616 section 19.5.1)
const m = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
if (m) {
entryName = m[2] || m[3] || '';
}
filename = _fileName(headerValue);
if (filename) {
parser.onPartData = appendToFile;
parser.onPartEnd = appendFileToFormData;
}
} else if (headerField === 'content-type') {
contentType = headerValue;
}
headerValue = '';
headerField = '';
};
for await (const chunk of Body) {
parser.write(chunk);
}
parser.end();
return formData;
}
/***/ })
};
;
//# sourceMappingURL=37.index.js.map

1
dist/setup/37.index.js.map generated vendored

File diff suppressed because one or more lines are too long

127
dist/setup/index.js generated vendored
View File

@@ -83722,16 +83722,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.STATE_CACHE_MATCHED_KEY = exports.STATE_CACHE_KEY = void 0; exports.STATE_CACHE_MATCHED_KEY = exports.STATE_CACHE_KEY = void 0;
exports.restoreCache = restoreCache; exports.restoreCache = restoreCache;
const cache = __importStar(__nccwpck_require__(7799)); const cache = __importStar(__nccwpck_require__(7799));
const glob = __importStar(__nccwpck_require__(8090)); const glob = __importStar(__nccwpck_require__(8090));
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const path_1 = __importDefault(__nccwpck_require__(1017));
const inputs_1 = __nccwpck_require__(9378); const inputs_1 = __nccwpck_require__(9378);
const platforms_1 = __nccwpck_require__(6005); const platforms_1 = __nccwpck_require__(6005);
exports.STATE_CACHE_KEY = "cache-key"; exports.STATE_CACHE_KEY = "cache-key";
@@ -83759,10 +83755,10 @@ function computeKeys(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let cacheDependencyPathHash = "-"; let cacheDependencyPathHash = "-";
if (inputs_1.cacheDependencyGlob !== "") { if (inputs_1.cacheDependencyGlob !== "") {
const fullCacheDependencyGlob = `${process.env["GITHUB_WORKSPACE"]}${path_1.default.sep}${inputs_1.cacheDependencyGlob}`; core.info(`Searching files using cache dependency glob: ${inputs_1.cacheDependencyGlob.split("\n").join(",")}`);
cacheDependencyPathHash += yield glob.hashFiles(fullCacheDependencyGlob); cacheDependencyPathHash += yield glob.hashFiles(inputs_1.cacheDependencyGlob, undefined, undefined, true);
if (cacheDependencyPathHash === "-") { if (cacheDependencyPathHash === "-") {
throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob}], make sure you have checked out the target repository`); throw new Error(`No file in ${process.cwd()} matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository`);
} }
} }
else { else {
@@ -83885,6 +83881,60 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KNOWN_CHECKSUMS = void 0; exports.KNOWN_CHECKSUMS = void 0;
// AUTOGENERATED_DO_NOT_EDIT // AUTOGENERATED_DO_NOT_EDIT
exports.KNOWN_CHECKSUMS = { exports.KNOWN_CHECKSUMS = {
"undefined-0.4.7": "2243b3636da44419b6d15df30db138f861a3c36991e9b9eb8ec43146c674df10",
"aarch64-apple-darwin-0.4.7": "a1fa60ccd00d9702e6d2792810226ce2c17d43807f38ab70c7418763693a3f7e",
"aarch64-unknown-linux-gnu-0.4.7": "b54ab2370cb726d40896e9e9b71ee08bb93aec656a80413515214699b64eb458",
"aarch64-unknown-linux-musl-0.4.7": "ec700622902ba26c465b4ff4a304dfdb9c0cd7cbcfe4e5dccba3f8e43f988934",
"arm-unknown-linux-musleabihf-0.4.7": "3f4a9dffba224b064f8947be8aa12f71aba931badbb2f2b0ad31c4a248f55470",
"armv7-unknown-linux-gnueabihf-0.4.7": "50d1a6da4ad12cc78bc011e01e9eeb8f881f37699c6b7ca0e3b0578e9553185b",
"armv7-unknown-linux-musleabihf-0.4.7": "7f1f5918c9634358703f4283c384375294d5f7c80ad7a7ef5cb83a008ac941da",
"i686-pc-windows-msvc-0.4.7": "cecb8bce8a911438c52ebdfbfbd516c5fa8111ff9c4c609224443b56074c409f",
"i686-unknown-linux-gnu-0.4.7": "a1117f56ed6e8b99d468fb147782314dc8e6e870d0e49a81f601e5bf61c54422",
"i686-unknown-linux-musl-0.4.7": "eecb9b2bc451d4eb44b629018fb1dd3cd9b775ff57110be680b75aa208fe8bf7",
"powerpc64-unknown-linux-gnu-0.4.7": "49569c1a10047dc9275ca439db69861c627ad6c0f906da1263f5925e41f92119",
"powerpc64le-unknown-linux-gnu-0.4.7": "a6ed76b1349fa098a1d7b54b8a3f05e7b80d15e2ef46302b001025809fc05b60",
"powerpc64le-unknown-linux-musl-0.4.7": "9f95bbac0b79034be0230325f5056d5964542899e3369d1c93718a1c5d84a6db",
"s390x-unknown-linux-gnu-0.4.7": "f852e6d71fbbe3a469f8215d3168b754321c09bd574a4ff3c6a12b168ac92640",
"x86_64-apple-darwin-0.4.7": "3c5df7248b25a688188d6f4a950e615574e87d8aa2dd56577b4325f15bf0ab9b",
"x86_64-pc-windows-msvc-0.4.7": "5bf8c7a9bda91c8aaa0a7d4aeaa25fe891010cb3336972fb3a58065b668f66e4",
"x86_64-unknown-linux-gnu-0.4.7": "a391db7b4c0b2c4b54be407df1a90ebba0542db468f25eefc2d56b7ab3282856",
"x86_64-unknown-linux-musl-0.4.7": "aea262a35d402a183b670f635be80dbe73fc9461aa2c9b57c5a3de538fc00017",
"undefined-0.4.6": "876a26e7cac5c7d9730ca619e06a117ea48085135412a0400787cef437fc6fcd",
"aarch64-apple-darwin-0.4.6": "3fa569aad68c8d3f6f96eccfb4def127411f795d819f90c7dbcdb4a3cec04667",
"aarch64-unknown-linux-gnu-0.4.6": "1c12f6dbe4cc88f17af8cde38d7b8fc7524cbbbe1b405f2b7243737680b87a8d",
"aarch64-unknown-linux-musl-0.4.6": "d3ade7505a8d8b76e3d022425cd3602323af5ec65373f2fdd30211d25e3b9253",
"arm-unknown-linux-musleabihf-0.4.6": "cfd84da6f080bcc89313280da1bbb0d8b1c74b830b5f8056e09af00ca0b4cb75",
"armv7-unknown-linux-gnueabihf-0.4.6": "285ebafea67216c27a3006c618275b6fc20a4643d631981684459aac4ce9e124",
"armv7-unknown-linux-musleabihf-0.4.6": "045ee86e317c3d82f07ec8685c1d4c983ba25f8284051fecfe76de6732e9ef3f",
"i686-pc-windows-msvc-0.4.6": "33289a7a2cc369831ae8384f0113f30c614a6be333ebef6abfc487decd50cf95",
"i686-unknown-linux-gnu-0.4.6": "3038fa755b71b333a1f919a3157dafaace4aaaa8dc2fe5d68d882c026962ad72",
"i686-unknown-linux-musl-0.4.6": "1638e9acb5dff0170e84cc7c9bb346a8ef2298999a236f1b7f8b8d4d4972431b",
"powerpc64-unknown-linux-gnu-0.4.6": "fba69a56be4b89179568b957eeed6b78a09ef6e00d9d21cf6f7e59c675983d13",
"powerpc64le-unknown-linux-gnu-0.4.6": "f14e76ca097ea841af0090bccc4d41015d1d6e839af095384ab24a36ed534bcd",
"powerpc64le-unknown-linux-musl-0.4.6": "a3bc7c30bd527470a49ba6ac9ab61b992e39c9ee687b1cbfe5d14d314ade17c6",
"s390x-unknown-linux-gnu-0.4.6": "351e1ec195545f7356f81142e0b7136ccdb7d342a361584dd7fb5c408345d3f1",
"x86_64-apple-darwin-0.4.6": "6b3971c57414ec91b55febc4d08e2e4724e9aa4c80e787e1a195c827048f9048",
"x86_64-pc-windows-msvc-0.4.6": "d48c8855f79933ab006b6a930bc611105aa52031f33aa80c32f1765a956dd92a",
"x86_64-unknown-linux-gnu-0.4.6": "68af9a5c41f38bfc4f625bbdc8a9f3921f7c384324ddd7773f078ddfe94eaa9a",
"x86_64-unknown-linux-musl-0.4.6": "984a0a07c7a83fc8b21c4b6ac1d81ddb08a5a30c35fd5608b969796a60cdcd25",
"undefined-0.4.5": "65442da160bc68062dda71a8dac009afff0745788f079cc596799ec24fd0f2ca",
"aarch64-apple-darwin-0.4.5": "e7e8496b494be710261e7524abeb59d7c92ecff949f33174598425bdd14aa519",
"aarch64-unknown-linux-gnu-0.4.5": "cf63221a8268116c2472f889e548c8d1ba3d8d0f2f77aa782e89202a2ff0e50d",
"aarch64-unknown-linux-musl-0.4.5": "f588424a62d0592967f2d467238a6749d3efee0a0d6ba855cd60eba662453efa",
"arm-unknown-linux-musleabihf-0.4.5": "0938a35cb3b381047f7480da1382da2f10551b5c92aba10f367a83ebaf6cb4bc",
"armv7-unknown-linux-gnueabihf-0.4.5": "46b7b5e4ee5498e0cb9a1150e68b61823919fab6ff4215f1d8be8e135826458e",
"armv7-unknown-linux-musleabihf-0.4.5": "7242649738791d9ca51f4afc5016e7ffb1e5f539b496637db6f2ea9afea45e29",
"i686-pc-windows-msvc-0.4.5": "b6efe473a6cf7f93ae060e040b5d7e9a988d67cbb9e089a4547c7e0ad7ed7323",
"i686-unknown-linux-gnu-0.4.5": "c296363ec6cc70b029272a449223fbf8992579dd977fa65c16ec338f026254f6",
"i686-unknown-linux-musl-0.4.5": "3482ad8aa6f8f5b06e3891008c50a53f5ff3de00ff4fbaa4caab040f8f05f11b",
"powerpc64-unknown-linux-gnu-0.4.5": "0368d675c188d56ba3527af02f63b0cb0179a8db95a62428ef0f5377b6ea72cc",
"powerpc64le-unknown-linux-gnu-0.4.5": "38c7a636e530114720935c4836faa2e4ca11c9b8c3c150a500158da4a7b60b31",
"powerpc64le-unknown-linux-musl-0.4.5": "1a33c9841b70b76b148618c910efa1f836e650fb007be1727db189e70f43e007",
"s390x-unknown-linux-gnu-0.4.5": "d9b8fb73eba7bf4d7addadce76735eee94791442a4e6d5ba46a6bc0478ed96d4",
"x86_64-apple-darwin-0.4.5": "50b87fa1dfe6526bb602781ccd862d2c8eed77abdc0a47606146f7594fa199a2",
"x86_64-pc-windows-msvc-0.4.5": "850c5718328883cbf88558d2420b6c82066925e258a6207cef1e5ba3931e5028",
"x86_64-unknown-linux-gnu-0.4.5": "a23e94ab0fb58beb2e7bc2f1d968fb30939b505f1bdab8df5cd1599c02f93793",
"x86_64-unknown-linux-musl-0.4.5": "e56d951c90bbff7a1b88c42403cd784af2d0233ea660b8b1b4282af872371f43",
"undefined-0.4.4": "32746c58071378ae79d5965f546915cbe85e94845c87111d4209ec3437052cb6", "undefined-0.4.4": "32746c58071378ae79d5965f546915cbe85e94845c87111d4209ec3437052cb6",
"aarch64-apple-darwin-0.4.4": "3d2e48f405023e0a1762ad66336fd4e615928343c90023972bf3418fa5c829ae", "aarch64-apple-darwin-0.4.4": "3d2e48f405023e0a1762ad66336fd4e615928343c90023972bf3418fa5c829ae",
"aarch64-unknown-linux-gnu-0.4.4": "f6851b5ef48caa066284b5522d153c49d55c310672962e7d0d8f2f4afab4a9b2", "aarch64-unknown-linux-gnu-0.4.4": "f6851b5ef48caa066284b5522d153c49d55c310672962e7d0d8f2f4afab4a9b2",
@@ -85584,11 +85634,11 @@ const tc = __importStar(__nccwpck_require__(7784));
const exec = __importStar(__nccwpck_require__(1514)); const exec = __importStar(__nccwpck_require__(1514));
const path = __importStar(__nccwpck_require__(1017)); const path = __importStar(__nccwpck_require__(1017));
const checksum_1 = __nccwpck_require__(4622); const checksum_1 = __nccwpck_require__(4622);
const utils_1 = __nccwpck_require__(239); const constants_1 = __nccwpck_require__(8593);
function downloadLatest(platform, arch, checkSum, githubToken) { function downloadLatest(platform, arch, checkSum, githubToken) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const artifact = `uv-${arch}-${platform}`; const artifact = `uv-${arch}-${platform}`;
let downloadUrl = `https://github.com/${utils_1.OWNER}/${utils_1.REPO}/releases/latest/download/${artifact}`; let downloadUrl = `https://github.com/${constants_1.OWNER}/${constants_1.REPO}/releases/latest/download/${artifact}`;
if (platform === "pc-windows-msvc") { if (platform === "pc-windows-msvc") {
downloadUrl += ".zip"; downloadUrl += ".zip";
} }
@@ -85611,7 +85661,7 @@ function downloadLatest(platform, arch, checkSum, githubToken) {
} }
const version = yield getVersion(uvExecutablePath); const version = yield getVersion(uvExecutablePath);
yield (0, checksum_1.validateChecksum)(checkSum, downloadPath, arch, platform, version); yield (0, checksum_1.validateChecksum)(checkSum, downloadPath, arch, platform, version);
const cachedToolDir = yield tc.cacheDir(uvDir, utils_1.TOOL_CACHE_NAME, version, arch); const cachedToolDir = yield tc.cacheDir(uvDir, constants_1.TOOL_CACHE_NAME, version, arch);
return { cachedToolDir, version }; return { cachedToolDir, version };
}); });
} }
@@ -85682,18 +85732,18 @@ exports.downloadVersion = downloadVersion;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const tc = __importStar(__nccwpck_require__(7784)); const tc = __importStar(__nccwpck_require__(7784));
const path = __importStar(__nccwpck_require__(1017)); const path = __importStar(__nccwpck_require__(1017));
const utils_1 = __nccwpck_require__(239); const constants_1 = __nccwpck_require__(8593);
const checksum_1 = __nccwpck_require__(4622); const checksum_1 = __nccwpck_require__(4622);
function tryGetFromToolCache(arch, version) { function tryGetFromToolCache(arch, version) {
core.debug(`Trying to get uv from tool cache for ${version}...`); core.debug(`Trying to get uv from tool cache for ${version}...`);
const cachedVersions = tc.findAllVersions(utils_1.TOOL_CACHE_NAME, arch); const cachedVersions = tc.findAllVersions(constants_1.TOOL_CACHE_NAME, arch);
core.debug(`Cached versions: ${cachedVersions}`); core.debug(`Cached versions: ${cachedVersions}`);
return tc.find(utils_1.TOOL_CACHE_NAME, version, arch); return tc.find(constants_1.TOOL_CACHE_NAME, version, arch);
} }
function downloadVersion(platform, arch, version, checkSum, githubToken) { function downloadVersion(platform, arch, version, checkSum, githubToken) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const artifact = `uv-${arch}-${platform}`; const artifact = `uv-${arch}-${platform}`;
let downloadUrl = `https://github.com/${utils_1.OWNER}/${utils_1.REPO}/releases/download/${version}/${artifact}`; let downloadUrl = `https://github.com/${constants_1.OWNER}/${constants_1.REPO}/releases/download/${version}/${artifact}`;
if (platform === "pc-windows-msvc") { if (platform === "pc-windows-msvc") {
downloadUrl += ".zip"; downloadUrl += ".zip";
} }
@@ -85712,7 +85762,7 @@ function downloadVersion(platform, arch, version, checkSum, githubToken) {
const extractedDir = yield tc.extractTar(downloadPath); const extractedDir = yield tc.extractTar(downloadPath);
uvDir = path.join(extractedDir, artifact); uvDir = path.join(extractedDir, artifact);
} }
return yield tc.cacheDir(uvDir, utils_1.TOOL_CACHE_NAME, version, arch); return yield tc.cacheDir(uvDir, constants_1.TOOL_CACHE_NAME, version, arch);
}); });
} }
@@ -85828,6 +85878,20 @@ function addMatchers() {
run(); run();
/***/ }),
/***/ 8593:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
exports.REPO = "uv";
exports.OWNER = "astral-sh";
exports.TOOL_CACHE_NAME = "uv";
/***/ }), /***/ }),
/***/ 9378: /***/ 9378:
@@ -85858,16 +85922,33 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.cacheDependencyGlob = exports.githubToken = exports.cacheLocalPath = exports.cacheSuffix = exports.enableCache = exports.checkSum = exports.version = void 0; exports.cacheDependencyGlob = exports.githubToken = exports.cacheLocalPath = exports.cacheSuffix = exports.enableCache = exports.checkSum = exports.version = void 0;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const path_1 = __importDefault(__nccwpck_require__(1017));
exports.version = core.getInput("version"); exports.version = core.getInput("version");
exports.checkSum = core.getInput("checksum"); exports.checkSum = core.getInput("checksum");
exports.enableCache = core.getInput("enable-cache") === "true"; exports.enableCache = core.getInput("enable-cache") === "true";
exports.cacheSuffix = core.getInput("cache-suffix") || ""; exports.cacheSuffix = core.getInput("cache-suffix") || "";
exports.cacheLocalPath = core.getInput("cache-local-path"); exports.cacheLocalPath = getCacheLocalPath();
exports.githubToken = core.getInput("github-token"); exports.githubToken = core.getInput("github-token");
exports.cacheDependencyGlob = core.getInput("cache-dependency-glob"); exports.cacheDependencyGlob = core.getInput("cache-dependency-glob");
function getCacheLocalPath() {
const cacheLocalPathInput = core.getInput("cache-local-path");
if (cacheLocalPathInput !== "") {
return cacheLocalPathInput;
}
if (process.env.RUNNER_TEMP !== undefined) {
return `${process.env.RUNNER_TEMP}${path_1.default.sep}setup-uv-cache`;
}
if (process.platform === "win32") {
return "D:\\a\\_temp\\setup-uv-cache";
}
return "/tmp/setup-uv-cache";
}
/***/ }), /***/ }),
@@ -85904,20 +85985,6 @@ function getPlatform() {
} }
/***/ }),
/***/ 239:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
exports.REPO = "uv";
exports.OWNER = "astral-sh";
exports.TOOL_CACHE_NAME = "uv";
/***/ }), /***/ }),
/***/ 2877: /***/ 2877:

1
dist/setup/index.js.map generated vendored

File diff suppressed because one or more lines are too long

1056
dist/setup/licenses.txt generated vendored

File diff suppressed because it is too large Load Diff

1
dist/setup/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long

35031
dist/update-checksums/index.js generated vendored

File diff suppressed because one or more lines are too long

1
dist/update-checksums/index.js.map generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

34791
dist/update-default-version/index.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -32787,7 +32787,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const github = __importStar(__nccwpck_require__(5438)); const github = __importStar(__nccwpck_require__(5438));
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const utils_1 = __nccwpck_require__(239); const constants_1 = __nccwpck_require__(8593);
const semver = __importStar(__nccwpck_require__(5911)); const semver = __importStar(__nccwpck_require__(5911));
const update_known_checksums_1 = __nccwpck_require__(7554); const update_known_checksums_1 = __nccwpck_require__(7554);
function run() { function run() {
@@ -32796,8 +32796,8 @@ function run() {
const github_token = process.argv.slice(2)[1]; const github_token = process.argv.slice(2)[1];
const octokit = github.getOctokit(github_token); const octokit = github.getOctokit(github_token);
const response = yield octokit.paginate(octokit.rest.repos.listReleases, { const response = yield octokit.paginate(octokit.rest.repos.listReleases, {
owner: utils_1.OWNER, owner: constants_1.OWNER,
repo: utils_1.REPO, repo: constants_1.REPO,
}); });
const downloadUrls = response.flatMap((release) => release.assets const downloadUrls = response.flatMap((release) => release.assets
.filter((asset) => asset.name.endsWith(".sha256")) .filter((asset) => asset.name.endsWith(".sha256"))
@@ -32814,7 +32814,7 @@ run();
/***/ }), /***/ }),
/***/ 239: /***/ 8593:
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
"use strict"; "use strict";

View File

@@ -1,7 +1,6 @@
import * as cache from "@actions/cache"; import * as cache from "@actions/cache";
import * as glob from "@actions/glob"; import * as glob from "@actions/glob";
import * as core from "@actions/core"; import * as core from "@actions/core";
import path from "path";
import { import {
cacheDependencyGlob, cacheDependencyGlob,
cacheLocalPath, cacheLocalPath,
@@ -37,11 +36,18 @@ export async function restoreCache(version: string): Promise<void> {
async function computeKeys(version: string): Promise<string> { async function computeKeys(version: string): Promise<string> {
let cacheDependencyPathHash = "-"; let cacheDependencyPathHash = "-";
if (cacheDependencyGlob !== "") { if (cacheDependencyGlob !== "") {
const fullCacheDependencyGlob = `${process.env["GITHUB_WORKSPACE"]}${path.sep}${cacheDependencyGlob}`; core.info(
cacheDependencyPathHash += await glob.hashFiles(fullCacheDependencyGlob); `Searching files using cache dependency glob: ${cacheDependencyGlob.split("\n").join(",")}`,
);
cacheDependencyPathHash += await glob.hashFiles(
cacheDependencyGlob,
undefined,
undefined,
true,
);
if (cacheDependencyPathHash === "-") { if (cacheDependencyPathHash === "-") {
throw new Error( throw new Error(
`No file in ${process.cwd()} matched to [${cacheDependencyGlob}], make sure you have checked out the target repository`, `No file in ${process.cwd()} matched to [${cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository`,
); );
} }
} else { } else {

View File

@@ -1,5 +1,113 @@
// AUTOGENERATED_DO_NOT_EDIT // AUTOGENERATED_DO_NOT_EDIT
export const KNOWN_CHECKSUMS: { [key: string]: string } = { export const KNOWN_CHECKSUMS: { [key: string]: string } = {
"undefined-0.4.7":
"2243b3636da44419b6d15df30db138f861a3c36991e9b9eb8ec43146c674df10",
"aarch64-apple-darwin-0.4.7":
"a1fa60ccd00d9702e6d2792810226ce2c17d43807f38ab70c7418763693a3f7e",
"aarch64-unknown-linux-gnu-0.4.7":
"b54ab2370cb726d40896e9e9b71ee08bb93aec656a80413515214699b64eb458",
"aarch64-unknown-linux-musl-0.4.7":
"ec700622902ba26c465b4ff4a304dfdb9c0cd7cbcfe4e5dccba3f8e43f988934",
"arm-unknown-linux-musleabihf-0.4.7":
"3f4a9dffba224b064f8947be8aa12f71aba931badbb2f2b0ad31c4a248f55470",
"armv7-unknown-linux-gnueabihf-0.4.7":
"50d1a6da4ad12cc78bc011e01e9eeb8f881f37699c6b7ca0e3b0578e9553185b",
"armv7-unknown-linux-musleabihf-0.4.7":
"7f1f5918c9634358703f4283c384375294d5f7c80ad7a7ef5cb83a008ac941da",
"i686-pc-windows-msvc-0.4.7":
"cecb8bce8a911438c52ebdfbfbd516c5fa8111ff9c4c609224443b56074c409f",
"i686-unknown-linux-gnu-0.4.7":
"a1117f56ed6e8b99d468fb147782314dc8e6e870d0e49a81f601e5bf61c54422",
"i686-unknown-linux-musl-0.4.7":
"eecb9b2bc451d4eb44b629018fb1dd3cd9b775ff57110be680b75aa208fe8bf7",
"powerpc64-unknown-linux-gnu-0.4.7":
"49569c1a10047dc9275ca439db69861c627ad6c0f906da1263f5925e41f92119",
"powerpc64le-unknown-linux-gnu-0.4.7":
"a6ed76b1349fa098a1d7b54b8a3f05e7b80d15e2ef46302b001025809fc05b60",
"powerpc64le-unknown-linux-musl-0.4.7":
"9f95bbac0b79034be0230325f5056d5964542899e3369d1c93718a1c5d84a6db",
"s390x-unknown-linux-gnu-0.4.7":
"f852e6d71fbbe3a469f8215d3168b754321c09bd574a4ff3c6a12b168ac92640",
"x86_64-apple-darwin-0.4.7":
"3c5df7248b25a688188d6f4a950e615574e87d8aa2dd56577b4325f15bf0ab9b",
"x86_64-pc-windows-msvc-0.4.7":
"5bf8c7a9bda91c8aaa0a7d4aeaa25fe891010cb3336972fb3a58065b668f66e4",
"x86_64-unknown-linux-gnu-0.4.7":
"a391db7b4c0b2c4b54be407df1a90ebba0542db468f25eefc2d56b7ab3282856",
"x86_64-unknown-linux-musl-0.4.7":
"aea262a35d402a183b670f635be80dbe73fc9461aa2c9b57c5a3de538fc00017",
"undefined-0.4.6":
"876a26e7cac5c7d9730ca619e06a117ea48085135412a0400787cef437fc6fcd",
"aarch64-apple-darwin-0.4.6":
"3fa569aad68c8d3f6f96eccfb4def127411f795d819f90c7dbcdb4a3cec04667",
"aarch64-unknown-linux-gnu-0.4.6":
"1c12f6dbe4cc88f17af8cde38d7b8fc7524cbbbe1b405f2b7243737680b87a8d",
"aarch64-unknown-linux-musl-0.4.6":
"d3ade7505a8d8b76e3d022425cd3602323af5ec65373f2fdd30211d25e3b9253",
"arm-unknown-linux-musleabihf-0.4.6":
"cfd84da6f080bcc89313280da1bbb0d8b1c74b830b5f8056e09af00ca0b4cb75",
"armv7-unknown-linux-gnueabihf-0.4.6":
"285ebafea67216c27a3006c618275b6fc20a4643d631981684459aac4ce9e124",
"armv7-unknown-linux-musleabihf-0.4.6":
"045ee86e317c3d82f07ec8685c1d4c983ba25f8284051fecfe76de6732e9ef3f",
"i686-pc-windows-msvc-0.4.6":
"33289a7a2cc369831ae8384f0113f30c614a6be333ebef6abfc487decd50cf95",
"i686-unknown-linux-gnu-0.4.6":
"3038fa755b71b333a1f919a3157dafaace4aaaa8dc2fe5d68d882c026962ad72",
"i686-unknown-linux-musl-0.4.6":
"1638e9acb5dff0170e84cc7c9bb346a8ef2298999a236f1b7f8b8d4d4972431b",
"powerpc64-unknown-linux-gnu-0.4.6":
"fba69a56be4b89179568b957eeed6b78a09ef6e00d9d21cf6f7e59c675983d13",
"powerpc64le-unknown-linux-gnu-0.4.6":
"f14e76ca097ea841af0090bccc4d41015d1d6e839af095384ab24a36ed534bcd",
"powerpc64le-unknown-linux-musl-0.4.6":
"a3bc7c30bd527470a49ba6ac9ab61b992e39c9ee687b1cbfe5d14d314ade17c6",
"s390x-unknown-linux-gnu-0.4.6":
"351e1ec195545f7356f81142e0b7136ccdb7d342a361584dd7fb5c408345d3f1",
"x86_64-apple-darwin-0.4.6":
"6b3971c57414ec91b55febc4d08e2e4724e9aa4c80e787e1a195c827048f9048",
"x86_64-pc-windows-msvc-0.4.6":
"d48c8855f79933ab006b6a930bc611105aa52031f33aa80c32f1765a956dd92a",
"x86_64-unknown-linux-gnu-0.4.6":
"68af9a5c41f38bfc4f625bbdc8a9f3921f7c384324ddd7773f078ddfe94eaa9a",
"x86_64-unknown-linux-musl-0.4.6":
"984a0a07c7a83fc8b21c4b6ac1d81ddb08a5a30c35fd5608b969796a60cdcd25",
"undefined-0.4.5":
"65442da160bc68062dda71a8dac009afff0745788f079cc596799ec24fd0f2ca",
"aarch64-apple-darwin-0.4.5":
"e7e8496b494be710261e7524abeb59d7c92ecff949f33174598425bdd14aa519",
"aarch64-unknown-linux-gnu-0.4.5":
"cf63221a8268116c2472f889e548c8d1ba3d8d0f2f77aa782e89202a2ff0e50d",
"aarch64-unknown-linux-musl-0.4.5":
"f588424a62d0592967f2d467238a6749d3efee0a0d6ba855cd60eba662453efa",
"arm-unknown-linux-musleabihf-0.4.5":
"0938a35cb3b381047f7480da1382da2f10551b5c92aba10f367a83ebaf6cb4bc",
"armv7-unknown-linux-gnueabihf-0.4.5":
"46b7b5e4ee5498e0cb9a1150e68b61823919fab6ff4215f1d8be8e135826458e",
"armv7-unknown-linux-musleabihf-0.4.5":
"7242649738791d9ca51f4afc5016e7ffb1e5f539b496637db6f2ea9afea45e29",
"i686-pc-windows-msvc-0.4.5":
"b6efe473a6cf7f93ae060e040b5d7e9a988d67cbb9e089a4547c7e0ad7ed7323",
"i686-unknown-linux-gnu-0.4.5":
"c296363ec6cc70b029272a449223fbf8992579dd977fa65c16ec338f026254f6",
"i686-unknown-linux-musl-0.4.5":
"3482ad8aa6f8f5b06e3891008c50a53f5ff3de00ff4fbaa4caab040f8f05f11b",
"powerpc64-unknown-linux-gnu-0.4.5":
"0368d675c188d56ba3527af02f63b0cb0179a8db95a62428ef0f5377b6ea72cc",
"powerpc64le-unknown-linux-gnu-0.4.5":
"38c7a636e530114720935c4836faa2e4ca11c9b8c3c150a500158da4a7b60b31",
"powerpc64le-unknown-linux-musl-0.4.5":
"1a33c9841b70b76b148618c910efa1f836e650fb007be1727db189e70f43e007",
"s390x-unknown-linux-gnu-0.4.5":
"d9b8fb73eba7bf4d7addadce76735eee94791442a4e6d5ba46a6bc0478ed96d4",
"x86_64-apple-darwin-0.4.5":
"50b87fa1dfe6526bb602781ccd862d2c8eed77abdc0a47606146f7594fa199a2",
"x86_64-pc-windows-msvc-0.4.5":
"850c5718328883cbf88558d2420b6c82066925e258a6207cef1e5ba3931e5028",
"x86_64-unknown-linux-gnu-0.4.5":
"a23e94ab0fb58beb2e7bc2f1d968fb30939b505f1bdab8df5cd1599c02f93793",
"x86_64-unknown-linux-musl-0.4.5":
"e56d951c90bbff7a1b88c42403cd784af2d0233ea660b8b1b4282af872371f43",
"undefined-0.4.4": "undefined-0.4.4":
"32746c58071378ae79d5965f546915cbe85e94845c87111d4209ec3437052cb6", "32746c58071378ae79d5965f546915cbe85e94845c87111d4209ec3437052cb6",
"aarch64-apple-darwin-0.4.4": "aarch64-apple-darwin-0.4.4":

View File

@@ -4,7 +4,7 @@ import * as exec from "@actions/exec";
import * as path from "path"; import * as path from "path";
import { Architecture, Platform } from "../utils/platforms"; import { Architecture, Platform } from "../utils/platforms";
import { validateChecksum } from "./checksum/checksum"; import { validateChecksum } from "./checksum/checksum";
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/utils"; import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
export async function downloadLatest( export async function downloadLatest(
platform: Platform, platform: Platform,

View File

@@ -1,7 +1,7 @@
import * as core from "@actions/core"; import * as core from "@actions/core";
import * as tc from "@actions/tool-cache"; import * as tc from "@actions/tool-cache";
import * as path from "path"; import * as path from "path";
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/utils"; import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
import { Architecture, Platform } from "../utils/platforms"; import { Architecture, Platform } from "../utils/platforms";
import { validateChecksum } from "./checksum/checksum"; import { validateChecksum } from "./checksum/checksum";

View File

@@ -1,7 +1,7 @@
import * as github from "@actions/github"; import * as github from "@actions/github";
import * as core from "@actions/core"; import * as core from "@actions/core";
import { OWNER, REPO } from "./utils/utils"; import { OWNER, REPO } from "./utils/constants";
import * as semver from "semver"; import * as semver from "semver";
import { updateChecksums } from "./download/checksum/update-known-checksums"; import { updateChecksums } from "./download/checksum/update-known-checksums";

View File

@@ -1,9 +1,24 @@
import * as core from "@actions/core"; import * as core from "@actions/core";
import path from "path";
export const version = core.getInput("version"); export const version = core.getInput("version");
export const checkSum = core.getInput("checksum"); export const checkSum = core.getInput("checksum");
export const enableCache = core.getInput("enable-cache") === "true"; export const enableCache = core.getInput("enable-cache") === "true";
export const cacheSuffix = core.getInput("cache-suffix") || ""; export const cacheSuffix = core.getInput("cache-suffix") || "";
export const cacheLocalPath = core.getInput("cache-local-path"); export const cacheLocalPath = getCacheLocalPath();
export const githubToken = core.getInput("github-token"); export const githubToken = core.getInput("github-token");
export const cacheDependencyGlob = core.getInput("cache-dependency-glob"); export const cacheDependencyGlob = core.getInput("cache-dependency-glob");
function getCacheLocalPath(): string {
const cacheLocalPathInput = core.getInput("cache-local-path");
if (cacheLocalPathInput !== "") {
return cacheLocalPathInput;
}
if (process.env.RUNNER_TEMP !== undefined) {
return `${process.env.RUNNER_TEMP}${path.sep}setup-uv-cache`;
}
if (process.platform === "win32") {
return "D:\\a\\_temp\\setup-uv-cache";
}
return "/tmp/setup-uv-cache";
}