Compare commits

..

1 Commits

Author SHA1 Message Date
776f9ba022 Release patch version update 2023-02-09 12:11:46 +00:00
10 changed files with 60 additions and 48 deletions

Binary file not shown.

View File

@ -31,7 +31,6 @@ See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/ac
* New actions are available for granular control over caches - [restore](restore/action.yml) and [save](save/action.yml).
* Support cross-os caching as an opt-in feature. See [Cross OS caching](./tips-and-workarounds.md#cross-os-cache) for more info.
* Added option to fail job on cache miss. See [Exit workflow on cache miss](./restore/README.md#exit-workflow-on-cache-miss) for more info.
* Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners
See the [v2 README.md](https://github.com/actions/cache/blob/v2/README.md) for older updates.

View File

@ -73,6 +73,3 @@
### 3.2.5
- Added fix to prevent from setting MYSYS environment variable globally.
### 3.2.6
- Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners.

View File

@ -1152,13 +1152,12 @@ function unlinkFile(filePath) {
});
}
exports.unlinkFile = unlinkFile;
function getVersion(app, additionalArgs = []) {
function getVersion(app) {
return __awaiter(this, void 0, void 0, function* () {
core.debug(`Checking ${app} --version`);
let versionOutput = '';
additionalArgs.push('--version');
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
try {
yield exec.exec(`${app}`, additionalArgs, {
yield exec.exec(`${app} --version`, [], {
ignoreReturnCode: true,
silent: true,
listeners: {
@ -1178,15 +1177,20 @@ function getVersion(app, additionalArgs = []) {
// Use zstandard if possible to maximize cache performance
function getCompressionMethod() {
return __awaiter(this, void 0, void 0, function* () {
const versionOutput = yield getVersion('zstd', ['--quiet']);
const versionOutput = yield getVersion('zstd');
const version = semver.clean(versionOutput);
core.debug(`zstd version: ${version}`);
if (versionOutput === '') {
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
// zstd is not installed
return constants_1.CompressionMethod.Gzip;
}
else {
else if (!version || semver.lt(version, 'v1.3.2')) {
// zstd is installed but using a version earlier than v1.3.2
// v1.3.2 is required to use the `--long` options in zstd
return constants_1.CompressionMethod.ZstdWithoutLong;
}
else {
return constants_1.CompressionMethod.Zstd;
}
});
}
exports.getCompressionMethod = getCompressionMethod;

20
dist/restore/index.js vendored
View File

@ -1152,13 +1152,12 @@ function unlinkFile(filePath) {
});
}
exports.unlinkFile = unlinkFile;
function getVersion(app, additionalArgs = []) {
function getVersion(app) {
return __awaiter(this, void 0, void 0, function* () {
core.debug(`Checking ${app} --version`);
let versionOutput = '';
additionalArgs.push('--version');
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
try {
yield exec.exec(`${app}`, additionalArgs, {
yield exec.exec(`${app} --version`, [], {
ignoreReturnCode: true,
silent: true,
listeners: {
@ -1178,15 +1177,20 @@ function getVersion(app, additionalArgs = []) {
// Use zstandard if possible to maximize cache performance
function getCompressionMethod() {
return __awaiter(this, void 0, void 0, function* () {
const versionOutput = yield getVersion('zstd', ['--quiet']);
const versionOutput = yield getVersion('zstd');
const version = semver.clean(versionOutput);
core.debug(`zstd version: ${version}`);
if (versionOutput === '') {
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
// zstd is not installed
return constants_1.CompressionMethod.Gzip;
}
else {
else if (!version || semver.lt(version, 'v1.3.2')) {
// zstd is installed but using a version earlier than v1.3.2
// v1.3.2 is required to use the `--long` options in zstd
return constants_1.CompressionMethod.ZstdWithoutLong;
}
else {
return constants_1.CompressionMethod.Zstd;
}
});
}
exports.getCompressionMethod = getCompressionMethod;

View File

@ -1208,13 +1208,12 @@ function unlinkFile(filePath) {
});
}
exports.unlinkFile = unlinkFile;
function getVersion(app, additionalArgs = []) {
function getVersion(app) {
return __awaiter(this, void 0, void 0, function* () {
core.debug(`Checking ${app} --version`);
let versionOutput = '';
additionalArgs.push('--version');
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
try {
yield exec.exec(`${app}`, additionalArgs, {
yield exec.exec(`${app} --version`, [], {
ignoreReturnCode: true,
silent: true,
listeners: {
@ -1234,15 +1233,20 @@ function getVersion(app, additionalArgs = []) {
// Use zstandard if possible to maximize cache performance
function getCompressionMethod() {
return __awaiter(this, void 0, void 0, function* () {
const versionOutput = yield getVersion('zstd', ['--quiet']);
const versionOutput = yield getVersion('zstd');
const version = semver.clean(versionOutput);
core.debug(`zstd version: ${version}`);
if (versionOutput === '') {
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
// zstd is not installed
return constants_1.CompressionMethod.Gzip;
}
else {
else if (!version || semver.lt(version, 'v1.3.2')) {
// zstd is installed but using a version earlier than v1.3.2
// v1.3.2 is required to use the `--long` options in zstd
return constants_1.CompressionMethod.ZstdWithoutLong;
}
else {
return constants_1.CompressionMethod.Zstd;
}
});
}
exports.getCompressionMethod = getCompressionMethod;

20
dist/save/index.js vendored
View File

@ -1152,13 +1152,12 @@ function unlinkFile(filePath) {
});
}
exports.unlinkFile = unlinkFile;
function getVersion(app, additionalArgs = []) {
function getVersion(app) {
return __awaiter(this, void 0, void 0, function* () {
core.debug(`Checking ${app} --version`);
let versionOutput = '';
additionalArgs.push('--version');
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
try {
yield exec.exec(`${app}`, additionalArgs, {
yield exec.exec(`${app} --version`, [], {
ignoreReturnCode: true,
silent: true,
listeners: {
@ -1178,15 +1177,20 @@ function getVersion(app, additionalArgs = []) {
// Use zstandard if possible to maximize cache performance
function getCompressionMethod() {
return __awaiter(this, void 0, void 0, function* () {
const versionOutput = yield getVersion('zstd', ['--quiet']);
const versionOutput = yield getVersion('zstd');
const version = semver.clean(versionOutput);
core.debug(`zstd version: ${version}`);
if (versionOutput === '') {
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
// zstd is not installed
return constants_1.CompressionMethod.Gzip;
}
else {
else if (!version || semver.lt(version, 'v1.3.2')) {
// zstd is installed but using a version earlier than v1.3.2
// v1.3.2 is required to use the `--long` options in zstd
return constants_1.CompressionMethod.ZstdWithoutLong;
}
else {
return constants_1.CompressionMethod.Zstd;
}
});
}
exports.getCompressionMethod = getCompressionMethod;

18
package-lock.json generated
View File

@ -1,15 +1,15 @@
{
"name": "cache",
"version": "3.2.6",
"version": "3.2.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "cache",
"version": "3.2.6",
"version": "3.2.5",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.1.4",
"@actions/cache": "^3.1.3",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
@ -36,9 +36,9 @@
}
},
"node_modules/@actions/cache": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.4.tgz",
"integrity": "sha512-Uh9wsz7SxunfyqF3UY/wfHI81z97CYQrZs4NU+whzYd0N8emTaloB+XtrAq46X2RbQEOBjF6R090jKQpX4coGg==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.3.tgz",
"integrity": "sha512-5YbATJUS6nVs9EkpK7JaliC3G5koKdJT99NLreL0gJlznudzZzXGNIheW5+HUT9C2DBvubOxYIyfX4v2UpZWrA==",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1",
@ -9722,9 +9722,9 @@
},
"dependencies": {
"@actions/cache": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.4.tgz",
"integrity": "sha512-Uh9wsz7SxunfyqF3UY/wfHI81z97CYQrZs4NU+whzYd0N8emTaloB+XtrAq46X2RbQEOBjF6R090jKQpX4coGg==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.3.tgz",
"integrity": "sha512-5YbATJUS6nVs9EkpK7JaliC3G5koKdJT99NLreL0gJlznudzZzXGNIheW5+HUT9C2DBvubOxYIyfX4v2UpZWrA==",
"requires": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "cache",
"version": "3.2.6",
"version": "3.2.5",
"private": true,
"description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js",
@ -23,7 +23,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.1.4",
"@actions/cache": "^3.1.3",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"

View File

@ -53,7 +53,7 @@ jobs:
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
BRANCH=${{ github.ref }}
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )