Fully automate CI/CD, evil multitargetting
This commit is contained in:
parent
a8a1f64705
commit
385c50a1d7
7 changed files with 159 additions and 188 deletions
121
.lune/pull.luau
121
.lune/pull.luau
|
@ -4,94 +4,10 @@ local net = require("@lune/net")
|
|||
local process = require("@lune/process")
|
||||
local serde = require("@lune/serde")
|
||||
|
||||
local types = require("./types")
|
||||
|
||||
print("-- 🟧 Starting pull of latest release...")
|
||||
|
||||
type wally_manifest = {
|
||||
package: {
|
||||
name: string,
|
||||
version: string,
|
||||
registry: string,
|
||||
realm: string,
|
||||
license: string?,
|
||||
exclude: { string }?,
|
||||
include: { string }?,
|
||||
},
|
||||
dependencies: {
|
||||
[string]: string,
|
||||
},
|
||||
}
|
||||
|
||||
type environment = "luau" | "lune" | "roblox" | "roblox_server"
|
||||
type pesde_dependency = {
|
||||
name: string,
|
||||
version: string,
|
||||
index: string?,
|
||||
target: environment?,
|
||||
} | {
|
||||
wally: string,
|
||||
version: string,
|
||||
index: string?,
|
||||
} | {
|
||||
repo: string,
|
||||
rev: string,
|
||||
path: string?,
|
||||
}
|
||||
|
||||
type pesde_manifest = {
|
||||
name: string,
|
||||
version: string,
|
||||
description: string?,
|
||||
license: string?,
|
||||
authors: { string }?,
|
||||
repository: string?,
|
||||
private: boolean?,
|
||||
includes: { string }?,
|
||||
pesde_version: string?,
|
||||
workspace_members: { string }?,
|
||||
|
||||
target: {
|
||||
environment: environment,
|
||||
lib: string,
|
||||
bin: string?,
|
||||
build_files: { string }?,
|
||||
},
|
||||
|
||||
scripts: {
|
||||
roblox_sync_config_generator: string?,
|
||||
sourcemap_generator: string?,
|
||||
|
||||
[string]: string,
|
||||
}?,
|
||||
|
||||
indices: {
|
||||
default: string,
|
||||
|
||||
[string]: string,
|
||||
},
|
||||
wally_indices: {
|
||||
default: string,
|
||||
|
||||
[string]: string,
|
||||
}?,
|
||||
|
||||
overrides: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
patches: {
|
||||
[string]: { [string]: string },
|
||||
}?,
|
||||
|
||||
dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
peer_dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
dev_dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
}
|
||||
|
||||
print("🟧 Fetching github token...")
|
||||
local github_token: string = process.args[1]
|
||||
|
||||
|
@ -114,7 +30,7 @@ if not pull_manifest_res.ok then
|
|||
error(`❌ Couldn't download jecs manifest: {pull_manifest_res.statusCode} {pull_manifest_res.statusMessage}`)
|
||||
end
|
||||
local manifest_contents = pull_manifest_res.body
|
||||
local manifest: wally_manifest = serde.decode("toml", manifest_contents) or error("Couldn't decode manifest.")
|
||||
local manifest: types.wally_manifest = serde.decode("toml", manifest_contents) or error("Couldn't decode manifest.")
|
||||
local jecs_version = manifest.package.version
|
||||
print(`✅ Got latest manifest. Version: {jecs_version}`)
|
||||
|
||||
|
@ -189,7 +105,7 @@ Install with pesde @ `marked/jecs`
|
|||
fs.writeFile("README.md", new_readme_contents)
|
||||
print(`✅ Modified README.md.`)
|
||||
|
||||
local pesde_manifest: pesde_manifest = {
|
||||
local pesde_manifest: types.pesde_manifest = {
|
||||
name = "marked/jecs",
|
||||
description = "A minimal copy of jecs published on the official pesde registry",
|
||||
version = jecs_version,
|
||||
|
@ -215,9 +131,38 @@ local pesde_manifest: pesde_manifest = {
|
|||
},
|
||||
}
|
||||
|
||||
local pesde_roblox_manifest: types.pesde_manifest = {
|
||||
name = "marked/jecs",
|
||||
description = "A minimal copy of jecs published on the official pesde registry",
|
||||
version = jecs_version,
|
||||
authors = { "jecs authors" },
|
||||
repository = "https://git.devmarked.win/marked/jecs-pesde",
|
||||
license = manifest.package.license,
|
||||
includes = {
|
||||
"init.luau",
|
||||
"pesde.toml",
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE",
|
||||
".luaurc",
|
||||
},
|
||||
|
||||
target = {
|
||||
environment = "roblox",
|
||||
lib = "init.luau",
|
||||
build_files = { "init.luau" },
|
||||
},
|
||||
|
||||
indices = {
|
||||
default = "https://github.com/pesde-pkg/index",
|
||||
},
|
||||
}
|
||||
|
||||
print("🟧 Writing pesde manifest...")
|
||||
local serialized_manifest = serde.encode("toml", pesde_manifest, true)
|
||||
fs.writeFile("pesde.toml", serialized_manifest)
|
||||
local serialized_rbx_manifest = serde.encode("toml", pesde_roblox_manifest, true)
|
||||
fs.writeFile("pesde-rbx.toml", serialized_rbx_manifest)
|
||||
print("✅ Wrote pesde manifest.")
|
||||
|
||||
print("-- ✅ Finished pulling latest release.")
|
||||
|
|
|
@ -2,79 +2,10 @@
|
|||
local fs = require("@lune/fs")
|
||||
local serde = require("@lune/serde")
|
||||
|
||||
type environment = "luau" | "lune" | "roblox" | "roblox_server"
|
||||
type pesde_dependency = {
|
||||
name: string,
|
||||
version: string,
|
||||
index: string?,
|
||||
target: environment?,
|
||||
} | {
|
||||
wally: string,
|
||||
version: string,
|
||||
index: string?,
|
||||
} | {
|
||||
repo: string,
|
||||
rev: string,
|
||||
path: string?,
|
||||
}
|
||||
|
||||
type pesde_manifest = {
|
||||
name: string,
|
||||
version: string,
|
||||
description: string?,
|
||||
license: string?,
|
||||
authors: { string }?,
|
||||
repository: string?,
|
||||
private: boolean?,
|
||||
includes: { string }?,
|
||||
pesde_version: string?,
|
||||
workspace_members: { string }?,
|
||||
|
||||
target: {
|
||||
environment: environment,
|
||||
lib: string,
|
||||
bin: string?,
|
||||
build_files: { string }?,
|
||||
},
|
||||
|
||||
scripts: {
|
||||
roblox_sync_config_generator: string?,
|
||||
sourcemap_generator: string?,
|
||||
|
||||
[string]: string,
|
||||
}?,
|
||||
|
||||
indices: {
|
||||
default: string,
|
||||
|
||||
[string]: string,
|
||||
},
|
||||
wally_indices: {
|
||||
default: string,
|
||||
|
||||
[string]: string,
|
||||
}?,
|
||||
|
||||
overrides: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
patches: {
|
||||
[string]: { [string]: string },
|
||||
}?,
|
||||
|
||||
dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
peer_dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
dev_dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
}
|
||||
local types = require("./types")
|
||||
|
||||
local manifest_contents = fs.readFile("pesde.toml")
|
||||
local manifest: pesde_manifest = serde.decode("toml", manifest_contents) or error("Couldn't decode manifest.")
|
||||
local manifest: types.pesde_manifest = serde.decode("toml", manifest_contents) or error("Couldn't decode manifest.")
|
||||
local jecs_version = manifest.version
|
||||
|
||||
print(jecs_version)
|
||||
|
|
88
.lune/types.luau
Normal file
88
.lune/types.luau
Normal file
|
@ -0,0 +1,88 @@
|
|||
--!strict
|
||||
export type wally_manifest = {
|
||||
package: {
|
||||
name: string,
|
||||
version: string,
|
||||
registry: string,
|
||||
realm: string,
|
||||
license: string?,
|
||||
exclude: { string }?,
|
||||
include: { string }?,
|
||||
},
|
||||
dependencies: {
|
||||
[string]: string,
|
||||
},
|
||||
}
|
||||
|
||||
export type environment = "luau" | "lune" | "roblox" | "roblox_server"
|
||||
export type pesde_dependency = {
|
||||
name: string,
|
||||
version: string,
|
||||
index: string?,
|
||||
target: environment?,
|
||||
} | {
|
||||
wally: string,
|
||||
version: string,
|
||||
index: string?,
|
||||
} | {
|
||||
repo: string,
|
||||
rev: string,
|
||||
path: string?,
|
||||
}
|
||||
|
||||
export type pesde_manifest = {
|
||||
name: string,
|
||||
version: string,
|
||||
description: string?,
|
||||
license: string?,
|
||||
authors: { string }?,
|
||||
repository: string?,
|
||||
private: boolean?,
|
||||
includes: { string }?,
|
||||
pesde_version: string?,
|
||||
workspace_members: { string }?,
|
||||
|
||||
target: {
|
||||
environment: environment,
|
||||
lib: string,
|
||||
bin: string?,
|
||||
build_files: { string }?,
|
||||
},
|
||||
|
||||
scripts: {
|
||||
roblox_sync_config_generator: string?,
|
||||
sourcemap_generator: string?,
|
||||
|
||||
[string]: string,
|
||||
}?,
|
||||
|
||||
indices: {
|
||||
default: string,
|
||||
|
||||
[string]: string,
|
||||
},
|
||||
wally_indices: {
|
||||
default: string,
|
||||
|
||||
[string]: string,
|
||||
}?,
|
||||
|
||||
overrides: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
patches: {
|
||||
[string]: { [string]: string },
|
||||
}?,
|
||||
|
||||
dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
peer_dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
dev_dependencies: {
|
||||
[string]: pesde_dependency,
|
||||
}?,
|
||||
}
|
||||
|
||||
return {}
|
Loading…
Add table
Add a link
Reference in a new issue