Compare commits

..

2 Commits

6 changed files with 53 additions and 7 deletions
+24 -1
View File
@@ -82512,6 +82512,10 @@ async function getBuildCachePath() {
const projectRootPath = getProjectRootPath(); const projectRootPath = getProjectRootPath();
if (projectRootPath && projectRootPath !== '' && fsutils.isDir(projectRootPath)) { if (projectRootPath && projectRootPath !== '' && fsutils.isDir(projectRootPath)) {
const options = {}; const options = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
options.cwd = projectRootPath; options.cwd = projectRootPath;
options.listeners = { options.listeners = {
stdout: (data) => { stdout: (data) => {
@@ -82599,7 +82603,12 @@ async function saveBuildCache() {
await io.cp(buildCachePath, fullCachePath, { await io.cp(buildCachePath, fullCachePath, {
recursive: true, recursive: true,
}); });
await (0, exec_1.exec)('xmake', ['l', 'os.touch', path.join(fullCachePath, 'build_cache_saved.txt')]); const options = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
await (0, exec_1.exec)('xmake', ['l', 'os.touch', path.join(fullCachePath, 'build_cache_saved.txt')], options);
await cache.saveCache([buildCacheFolder], buildCacheKey); await cache.saveCache([buildCacheFolder], buildCacheKey);
} }
} }
@@ -82801,6 +82810,10 @@ async function getPackageCacheKey() {
const projectRootPath = getProjectRootPath(); const projectRootPath = getProjectRootPath();
if (projectRootPath && projectRootPath !== '' && fsutils.isDir(projectRootPath)) { if (projectRootPath && projectRootPath !== '' && fsutils.isDir(projectRootPath)) {
const options = {}; const options = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
options.cwd = projectRootPath; options.cwd = projectRootPath;
options.listeners = { options.listeners = {
stdout: (data) => { stdout: (data) => {
@@ -82816,6 +82829,10 @@ async function getPackageCacheKey() {
async function getPackageCachePath() { async function getPackageCachePath() {
let packageCachePath = ''; let packageCachePath = '';
const options = {}; const options = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
options.listeners = { options.listeners = {
stdout: (data) => { stdout: (data) => {
packageCachePath += data.toString(); packageCachePath += data.toString();
@@ -82880,6 +82897,12 @@ async function savePackageCache() {
await io.cp(packageCachePath, fullCachePath, { await io.cp(packageCachePath, fullCachePath, {
recursive: true, recursive: true,
}); });
const options = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
await (0, exec_1.exec)('xmake', ['l', 'os.touch', path.join(fullCachePath, 'package_cache_saved.txt')], options);
await cache.saveCache([packageCacheFolder], packageCacheKey); await cache.saveCache([packageCacheFolder], packageCacheKey);
} }
} }
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "github-action-setup-xmake", "name": "github-action-setup-xmake",
"version": "1.1.5", "version": "1.1.6",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "github-action-setup-xmake", "name": "github-action-setup-xmake",
"version": "1.1.5", "version": "1.1.6",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"dependencies": { "dependencies": {
"@actions/cache": "^3.2.4", "@actions/cache": "^3.2.4",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "github-action-setup-xmake", "name": "github-action-setup-xmake",
"version": "1.1.5", "version": "1.1.6",
"description": "Set up your GitHub Actions workflow with a specific version of xmake", "description": "Set up your GitHub Actions workflow with a specific version of xmake",
"main": "dist/index.js", "main": "dist/index.js",
"author": "OpportunityLiu", "author": "OpportunityLiu",
+10 -1
View File
@@ -56,6 +56,10 @@ async function getBuildCachePath(): Promise<string> {
const projectRootPath = getProjectRootPath(); const projectRootPath = getProjectRootPath();
if (projectRootPath && projectRootPath !== '' && fsutils.isDir(projectRootPath)) { if (projectRootPath && projectRootPath !== '' && fsutils.isDir(projectRootPath)) {
const options: ExecOptions = {}; const options: ExecOptions = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
options.cwd = projectRootPath; options.cwd = projectRootPath;
options.listeners = { options.listeners = {
stdout: (data: Buffer) => { stdout: (data: Buffer) => {
@@ -153,7 +157,12 @@ export async function saveBuildCache(): Promise<void> {
await io.cp(buildCachePath, fullCachePath, { await io.cp(buildCachePath, fullCachePath, {
recursive: true, recursive: true,
}); });
await exec('xmake', ['l', 'os.touch', path.join(fullCachePath, 'build_cache_saved.txt')]); const options: ExecOptions = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
await exec('xmake', ['l', 'os.touch', path.join(fullCachePath, 'build_cache_saved.txt')], options);
await cache.saveCache([buildCacheFolder], buildCacheKey); await cache.saveCache([buildCacheFolder], buildCacheKey);
} }
} }
+14
View File
@@ -27,6 +27,10 @@ async function getPackageCacheKey(): Promise<string> {
const projectRootPath = getProjectRootPath(); const projectRootPath = getProjectRootPath();
if (projectRootPath && projectRootPath !== '' && fsutils.isDir(projectRootPath)) { if (projectRootPath && projectRootPath !== '' && fsutils.isDir(projectRootPath)) {
const options: ExecOptions = {}; const options: ExecOptions = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
options.cwd = projectRootPath; options.cwd = projectRootPath;
options.listeners = { options.listeners = {
stdout: (data: Buffer) => { stdout: (data: Buffer) => {
@@ -43,6 +47,10 @@ async function getPackageCacheKey(): Promise<string> {
async function getPackageCachePath(): Promise<string> { async function getPackageCachePath(): Promise<string> {
let packageCachePath = ''; let packageCachePath = '';
const options: ExecOptions = {}; const options: ExecOptions = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
options.listeners = { options.listeners = {
stdout: (data: Buffer) => { stdout: (data: Buffer) => {
packageCachePath += data.toString(); packageCachePath += data.toString();
@@ -112,6 +120,12 @@ export async function savePackageCache(): Promise<void> {
await io.cp(packageCachePath, fullCachePath, { await io.cp(packageCachePath, fullCachePath, {
recursive: true, recursive: true,
}); });
const options: ExecOptions = {};
options.env = {
...process.env,
XMAKE_ROOT: 'y',
};
await exec('xmake', ['l', 'os.touch', path.join(fullCachePath, 'package_cache_saved.txt')], options);
await cache.saveCache([packageCacheFolder], packageCacheKey); await cache.saveCache([packageCacheFolder], packageCacheKey);
} }
} }
+2 -2
View File
@@ -1,9 +1,9 @@
add_rules("mode.debug", "mode.release") add_rules("mode.debug", "mode.release")
add_requires("libpng", "libogg", {system = false}) add_requires("libpng", "libogg", "libplist", {system = false})
target("sample") target("sample")
set_kind("binary") set_kind("binary")
add_files("src/*.cpp") add_files("src/*.cpp")
add_packages("libpng", "libogg") add_packages("libpng", "libogg", "libplist")