1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-19 19:46:17 +02:00
This commit is contained in:
Caleb Gosiak 2021-09-30 17:39:26 -05:00
parent ef015fc7a1
commit 3b3f1ff398
4 changed files with 19 additions and 22 deletions

12
dist/restore/index.js vendored
View file

@ -43365,12 +43365,10 @@ class CacheService {
return this._client return this._client
.putObject({ .putObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), key), Key: path.join(this.getCacheFolder(), `${key}.tgz`),
Body: data, Body: data,
Metadata: { ContentType: "text/plain",
ContentType: "text/plain", ContentEncoding: "gzip"
ContentEncoding: "gzip"
}
}) })
.promise(); .promise();
}); });
@ -43381,7 +43379,7 @@ class CacheService {
const response = yield this._client const response = yield this._client
.getObject({ .getObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), key) Key: path.join(this.getCacheFolder(), `${key}.tgz`)
}) })
.promise(); .promise();
fs_1.default.writeFileSync(savePath, response.Body); fs_1.default.writeFileSync(savePath, response.Body);
@ -43402,7 +43400,7 @@ class CacheService {
yield this._client yield this._client
.headObject({ .headObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), keys[i]) Key: path.join(this.getCacheFolder(), `${keys[i]}.tgz`)
}) })
.promise(); .promise();
return keys[i]; return keys[i];

12
dist/save/index.js vendored
View file

@ -43365,12 +43365,10 @@ class CacheService {
return this._client return this._client
.putObject({ .putObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), key), Key: path.join(this.getCacheFolder(), `${key}.tgz`),
Body: data, Body: data,
Metadata: { ContentType: "text/plain",
ContentType: "text/plain", ContentEncoding: "gzip"
ContentEncoding: "gzip"
}
}) })
.promise(); .promise();
}); });
@ -43381,7 +43379,7 @@ class CacheService {
const response = yield this._client const response = yield this._client
.getObject({ .getObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), key) Key: path.join(this.getCacheFolder(), `${key}.tgz`)
}) })
.promise(); .promise();
fs_1.default.writeFileSync(savePath, response.Body); fs_1.default.writeFileSync(savePath, response.Body);
@ -43402,7 +43400,7 @@ class CacheService {
yield this._client yield this._client
.headObject({ .headObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), keys[i]) Key: path.join(this.getCacheFolder(), `${keys[i]}.tgz`)
}) })
.promise(); .promise();
return keys[i]; return keys[i];

View file

@ -1,6 +1,6 @@
{ {
"name": "cache", "name": "cache",
"version": "0.6.0", "version": "0.7.0",
"private": true, "private": true,
"description": "Cache dependencies and build outputs", "description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js", "main": "dist/restore/index.js",

View file

@ -132,12 +132,10 @@ export class CacheService {
return this._client return this._client
.putObject({ .putObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), key), Key: path.join(this.getCacheFolder(), `${key}.tgz`),
Body: data, Body: data,
Metadata: { ContentType: "text/plain",
ContentType: "text/plain", ContentEncoding: "gzip"
ContentEncoding: "gzip"
}
}) })
.promise(); .promise();
} }
@ -147,7 +145,7 @@ export class CacheService {
const response: GetObjectOutput = await this._client const response: GetObjectOutput = await this._client
.getObject({ .getObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), key) Key: path.join(this.getCacheFolder(), `${key}.tgz`)
}) })
.promise(); .promise();
fs.writeFileSync(savePath, response.Body); fs.writeFileSync(savePath, response.Body);
@ -166,7 +164,10 @@ export class CacheService {
await this._client await this._client
.headObject({ .headObject({
Bucket: this._bucket, Bucket: this._bucket,
Key: path.join(this.getCacheFolder(), keys[i]) Key: path.join(
this.getCacheFolder(),
`${keys[i]}.tgz`
)
}) })
.promise(); .promise();
return keys[i]; return keys[i];