lua-obfuscator 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +14 -0
- package/dist/index.js +58 -0
- package/dist/prometheus/LICENSE +661 -0
- package/dist/prometheus/benchmark.lua +34 -0
- package/dist/prometheus/build.bat +10 -0
- package/dist/prometheus/cli.lua +12 -0
- package/dist/prometheus/doc/README.md +11 -0
- package/dist/prometheus/doc/SUMMARY.md +27 -0
- package/dist/prometheus/doc/advanced/using-prometheus-in-your-lua-application.md +31 -0
- package/dist/prometheus/doc/getting-started/command-line-options.md +13 -0
- package/dist/prometheus/doc/getting-started/installation.md +11 -0
- package/dist/prometheus/doc/getting-started/obfuscating-your-first-script.md +50 -0
- package/dist/prometheus/doc/getting-started/presets.md +10 -0
- package/dist/prometheus/doc/getting-started/the-config-object.md +58 -0
- package/dist/prometheus/doc/getting-started/writing-a-custom-config-file.md +56 -0
- package/dist/prometheus/doc/steps/anti-tamper.md +11 -0
- package/dist/prometheus/doc/steps/constantarray.md +71 -0
- package/dist/prometheus/doc/steps/encryptstrings.md +86 -0
- package/dist/prometheus/doc/steps/proxifylocals.md +47 -0
- package/dist/prometheus/doc/steps/splitstrings.md +40 -0
- package/dist/prometheus/doc/steps/vmify.md +9 -0
- package/dist/prometheus/doc/steps/wrapinfunction.md +29 -0
- package/dist/prometheus/prometheus-main.lua +1 -0
- package/dist/prometheus/readme.md +57 -0
- package/dist/prometheus/readme.txt +5 -0
- package/dist/prometheus/src/cli.lua +154 -0
- package/dist/prometheus/src/colors.lua +61 -0
- package/dist/prometheus/src/config.lua +35 -0
- package/dist/prometheus/src/highlightlua.lua +61 -0
- package/dist/prometheus/src/logger.lua +62 -0
- package/dist/prometheus/src/presets.lua +174 -0
- package/dist/prometheus/src/prometheus/ast.lua +792 -0
- package/dist/prometheus/src/prometheus/bit.lua +521 -0
- package/dist/prometheus/src/prometheus/compiler/compiler.lua +2365 -0
- package/dist/prometheus/src/prometheus/enums.lua +106 -0
- package/dist/prometheus/src/prometheus/namegenerators/Il.lua +41 -0
- package/dist/prometheus/src/prometheus/namegenerators/confuse.lua +169 -0
- package/dist/prometheus/src/prometheus/namegenerators/mangled.lua +26 -0
- package/dist/prometheus/src/prometheus/namegenerators/mangled_shuffled.lua +35 -0
- package/dist/prometheus/src/prometheus/namegenerators/number.lua +11 -0
- package/dist/prometheus/src/prometheus/namegenerators.lua +7 -0
- package/dist/prometheus/src/prometheus/parser.lua +969 -0
- package/dist/prometheus/src/prometheus/pipeline.lua +250 -0
- package/dist/prometheus/src/prometheus/randomLiterals.lua +41 -0
- package/dist/prometheus/src/prometheus/randomStrings.lua +24 -0
- package/dist/prometheus/src/prometheus/scope.lua +332 -0
- package/dist/prometheus/src/prometheus/step.lua +79 -0
- package/dist/prometheus/src/prometheus/steps/AddVararg.lua +33 -0
- package/dist/prometheus/src/prometheus/steps/AntiTamper.lua +194 -0
- package/dist/prometheus/src/prometheus/steps/ConstantArray.lua +521 -0
- package/dist/prometheus/src/prometheus/steps/EncryptStrings.lua +239 -0
- package/dist/prometheus/src/prometheus/steps/NumbersToExpressions.lua +82 -0
- package/dist/prometheus/src/prometheus/steps/ProxifyLocals.lua +313 -0
- package/dist/prometheus/src/prometheus/steps/SplitStrings.lua +338 -0
- package/dist/prometheus/src/prometheus/steps/Vmify.lua +30 -0
- package/dist/prometheus/src/prometheus/steps/Watermark.lua +61 -0
- package/dist/prometheus/src/prometheus/steps/WatermarkCheck.lua +50 -0
- package/dist/prometheus/src/prometheus/steps/WrapInFunction.lua +45 -0
- package/dist/prometheus/src/prometheus/steps.lua +12 -0
- package/dist/prometheus/src/prometheus/tokenizer.lua +546 -0
- package/dist/prometheus/src/prometheus/unparser.lua +866 -0
- package/dist/prometheus/src/prometheus/util.lua +297 -0
- package/dist/prometheus/src/prometheus/visitast.lua +245 -0
- package/dist/prometheus/src/prometheus.lua +71 -0
- package/dist/prometheus/tests/closures.lua +12 -0
- package/dist/prometheus/tests/fibonacci.lua +10 -0
- package/dist/prometheus/tests/loops.lua +8 -0
- package/dist/prometheus/tests/primes.lua +18 -0
- package/dist/prometheus/tests.lua +149 -0
- package/package.json +25 -0
- package/src/index.ts +76 -0
- package/src/prometheus/.editorconfig +4 -0
- package/src/prometheus/.gitattributes +2 -0
- package/src/prometheus/.gitbook.yaml +1 -0
- package/src/prometheus/.github/ISSUE_TEMPLATE/bug_report.md +25 -0
- package/src/prometheus/.github/workflows/Build.yml +49 -0
- package/src/prometheus/.github/workflows/Test.yml +19 -0
- package/src/prometheus/LICENSE +661 -0
- package/src/prometheus/benchmark.lua +34 -0
- package/src/prometheus/build.bat +10 -0
- package/src/prometheus/cli.lua +12 -0
- package/src/prometheus/doc/README.md +11 -0
- package/src/prometheus/doc/SUMMARY.md +27 -0
- package/src/prometheus/doc/advanced/using-prometheus-in-your-lua-application.md +31 -0
- package/src/prometheus/doc/getting-started/command-line-options.md +13 -0
- package/src/prometheus/doc/getting-started/installation.md +11 -0
- package/src/prometheus/doc/getting-started/obfuscating-your-first-script.md +50 -0
- package/src/prometheus/doc/getting-started/presets.md +10 -0
- package/src/prometheus/doc/getting-started/the-config-object.md +58 -0
- package/src/prometheus/doc/getting-started/writing-a-custom-config-file.md +56 -0
- package/src/prometheus/doc/steps/anti-tamper.md +11 -0
- package/src/prometheus/doc/steps/constantarray.md +71 -0
- package/src/prometheus/doc/steps/encryptstrings.md +86 -0
- package/src/prometheus/doc/steps/proxifylocals.md +47 -0
- package/src/prometheus/doc/steps/splitstrings.md +40 -0
- package/src/prometheus/doc/steps/vmify.md +9 -0
- package/src/prometheus/doc/steps/wrapinfunction.md +29 -0
- package/src/prometheus/prometheus-main.lua +1 -0
- package/src/prometheus/readme.md +57 -0
- package/src/prometheus/readme.txt +5 -0
- package/src/prometheus/src/cli.lua +154 -0
- package/src/prometheus/src/colors.lua +61 -0
- package/src/prometheus/src/highlightlua.lua +61 -0
- package/src/prometheus/src/logger.lua +62 -0
- package/src/prometheus/src/presets.lua +174 -0
- package/src/prometheus/src/prometheus/ast.lua +792 -0
- package/src/prometheus/src/prometheus/bit.lua +521 -0
- package/src/prometheus/src/prometheus/compiler/compiler.lua +2365 -0
- package/src/prometheus/src/prometheus/enums.lua +106 -0
- package/src/prometheus/src/prometheus/namegenerators/Il.lua +41 -0
- package/src/prometheus/src/prometheus/namegenerators/confuse.lua +169 -0
- package/src/prometheus/src/prometheus/namegenerators/mangled.lua +26 -0
- package/src/prometheus/src/prometheus/namegenerators/mangled_shuffled.lua +35 -0
- package/src/prometheus/src/prometheus/namegenerators/number.lua +11 -0
- package/src/prometheus/src/prometheus/namegenerators.lua +7 -0
- package/src/prometheus/src/prometheus/parser.lua +969 -0
- package/src/prometheus/src/prometheus/pipeline.lua +250 -0
- package/src/prometheus/src/prometheus/randomLiterals.lua +41 -0
- package/src/prometheus/src/prometheus/randomStrings.lua +24 -0
- package/src/prometheus/src/prometheus/scope.lua +332 -0
- package/src/prometheus/src/prometheus/step.lua +79 -0
- package/src/prometheus/src/prometheus/steps/AddVararg.lua +33 -0
- package/src/prometheus/src/prometheus/steps/AntiTamper.lua +194 -0
- package/src/prometheus/src/prometheus/steps/ConstantArray.lua +521 -0
- package/src/prometheus/src/prometheus/steps/EncryptStrings.lua +239 -0
- package/src/prometheus/src/prometheus/steps/NumbersToExpressions.lua +82 -0
- package/src/prometheus/src/prometheus/steps/ProxifyLocals.lua +313 -0
- package/src/prometheus/src/prometheus/steps/SplitStrings.lua +338 -0
- package/src/prometheus/src/prometheus/steps/Vmify.lua +30 -0
- package/src/prometheus/src/prometheus/steps/Watermark.lua +61 -0
- package/src/prometheus/src/prometheus/steps/WatermarkCheck.lua +50 -0
- package/src/prometheus/src/prometheus/steps/WrapInFunction.lua +45 -0
- package/src/prometheus/src/prometheus/steps.lua +12 -0
- package/src/prometheus/src/prometheus/tokenizer.lua +546 -0
- package/src/prometheus/src/prometheus/unparser.lua +866 -0
- package/src/prometheus/src/prometheus/util.lua +297 -0
- package/src/prometheus/src/prometheus/visitast.lua +245 -0
- package/src/prometheus/src/prometheus.lua +71 -0
- package/src/prometheus/tests/closures.lua +12 -0
- package/src/prometheus/tests/fibonacci.lua +10 -0
- package/src/prometheus/tests/loops.lua +8 -0
- package/src/prometheus/tests/primes.lua +18 -0
- package/src/prometheus/tests.lua +149 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
-- This Script is Part of the Prometheus Obfuscator by Levno_710
|
|
2
|
+
--
|
|
3
|
+
-- test.lua
|
|
4
|
+
-- This file will Perform tests using all lua files within the tests directory
|
|
5
|
+
|
|
6
|
+
-- Require Prometheus
|
|
7
|
+
local Prometheus = require("src.prometheus")
|
|
8
|
+
|
|
9
|
+
-- Enable Debugging
|
|
10
|
+
-- logger.logLevel = logger.LogLevel.Debug;
|
|
11
|
+
|
|
12
|
+
-- Config Variables - Later passed as Parameters
|
|
13
|
+
local noColors = false; -- Wether Colors in the Console output should be enabled
|
|
14
|
+
local isWindows = true; -- Wether the Test are Performed on a Windows or Linux System
|
|
15
|
+
local ciMode = false; -- Wether the Test error are ignored or not
|
|
16
|
+
|
|
17
|
+
for _, currArg in pairs(arg) do
|
|
18
|
+
if currArg == "--Linux" then
|
|
19
|
+
isWindows = false
|
|
20
|
+
end
|
|
21
|
+
if currArg == "--CI" then
|
|
22
|
+
ciMode = true
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
-- Enable/Disable Console Colors - this may be needed because cmd.exe and powershell.exe do not support ANSI Color Escape Sequences. The Windows Terminal Application is needed
|
|
27
|
+
Prometheus.colors.enabled = not noColors;
|
|
28
|
+
|
|
29
|
+
-- Apply Obfuscation Pipeline
|
|
30
|
+
local pipeline = Prometheus.Pipeline:new({
|
|
31
|
+
Seed = 0; -- For Using Time as Seed
|
|
32
|
+
VarNamePrefix = ""; -- No Custom Prefix
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
-- "Mangled" for names like this : a, b, c, d, ...
|
|
36
|
+
-- "MangledShuffled" is the same except the chars come in a different order - Recomended
|
|
37
|
+
-- "Il" for weird names like this : IlIIl1llI11l1 - Recomended to make less readable
|
|
38
|
+
-- "Number" for names like this : _1, _2, _3, ... - Not recomended
|
|
39
|
+
pipeline:setNameGenerator("MangledShuffled");
|
|
40
|
+
|
|
41
|
+
print("Performing Prometheus Tests ...")
|
|
42
|
+
local function scandir(directory)
|
|
43
|
+
local i, t, popen = 0, {}, io.popen
|
|
44
|
+
local pfile = popen(isWindows and 'dir "'..directory..'" /b' or 'ls -a "'..directory..'"')
|
|
45
|
+
for filename in pfile:lines() do
|
|
46
|
+
if string.sub(filename, -4) == ".lua" then
|
|
47
|
+
i = i + 1
|
|
48
|
+
t[i] = filename
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
pfile:close()
|
|
52
|
+
return t
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
local function shallowcopy(orig)
|
|
56
|
+
local orig_type = type(orig)
|
|
57
|
+
local copy
|
|
58
|
+
if orig_type == 'table' then
|
|
59
|
+
copy = {}
|
|
60
|
+
for orig_key, orig_value in pairs(orig) do
|
|
61
|
+
copy[orig_key] = orig_value
|
|
62
|
+
end
|
|
63
|
+
else -- number, string, boolean, etc
|
|
64
|
+
copy = orig
|
|
65
|
+
end
|
|
66
|
+
return copy
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
local function validate(a, b)
|
|
70
|
+
local outa = "";
|
|
71
|
+
local outb = "";
|
|
72
|
+
|
|
73
|
+
local enva = shallowcopy(getfenv(a));
|
|
74
|
+
local envb = shallowcopy(getfenv(a));
|
|
75
|
+
|
|
76
|
+
enva.print = function(...)
|
|
77
|
+
for i, v in ipairs({...}) do
|
|
78
|
+
outa = outa .. tostring(v);
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
envb.print = function(...)
|
|
83
|
+
for i, v in ipairs({...}) do
|
|
84
|
+
outb = outb .. tostring(v);
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
setfenv(a, enva);
|
|
89
|
+
setfenv(b, envb);
|
|
90
|
+
|
|
91
|
+
if(not pcall(a)) then error("Expected Reference Program not to Fail!") end
|
|
92
|
+
if(not pcall(b)) then return false, outa, nil end
|
|
93
|
+
|
|
94
|
+
return outa == outb, outa, outb
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
local presets = Prometheus.Presets;
|
|
99
|
+
local testdir = "./tests/"
|
|
100
|
+
local failed = {};
|
|
101
|
+
Prometheus.Logger.logLevel = Prometheus.Logger.LogLevel.Error;
|
|
102
|
+
local fc = 0;
|
|
103
|
+
for i, filename in ipairs(scandir(testdir)) do
|
|
104
|
+
local path = testdir .. filename;
|
|
105
|
+
local file = io.open(path,"r");
|
|
106
|
+
|
|
107
|
+
local code = file:read("*a");
|
|
108
|
+
print(Prometheus.colors("[CURRENT] ", "magenta") .. filename);
|
|
109
|
+
for name, preset in pairs(presets) do
|
|
110
|
+
for i = #preset.Steps, 1, -1 do
|
|
111
|
+
if preset.Steps[i].Name == "AntiTamper" then
|
|
112
|
+
table.remove(preset.Steps, i);
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
pipeline = Prometheus.Pipeline:fromConfig(preset);
|
|
116
|
+
local obfuscated = pipeline:apply(code);
|
|
117
|
+
|
|
118
|
+
local funca = loadstring(code);
|
|
119
|
+
local funcb = loadstring(obfuscated);
|
|
120
|
+
|
|
121
|
+
if funcb == nil then
|
|
122
|
+
print(Prometheus.colors("[FAILED] ", "red") .. "(" .. filename .. "): " .. name .. ", Invalid Lua!");
|
|
123
|
+
print("[SOURCE]", obfuscated);
|
|
124
|
+
fc = fc + 1;
|
|
125
|
+
else
|
|
126
|
+
local validated, outa, outb = validate(funca, funcb);
|
|
127
|
+
|
|
128
|
+
if not validated then
|
|
129
|
+
print(Prometheus.colors("[FAILED] ", "red") .. "(" .. filename .. "): " .. name);
|
|
130
|
+
print("[OUTA] ", outa);
|
|
131
|
+
print("[OUTB] ", outb);
|
|
132
|
+
print("[SOURCE]", obfuscated);
|
|
133
|
+
fc = fc + 1;
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
file:close();
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if fc < 1 then
|
|
141
|
+
print(Prometheus.colors("[PASSED] ", "green") .. "All tests passed!");
|
|
142
|
+
return 0;
|
|
143
|
+
else
|
|
144
|
+
print(Prometheus.colors("[FAILED] ", "red") .. "Some tests failed!");
|
|
145
|
+
if ciMode then
|
|
146
|
+
error("Test Failed!")
|
|
147
|
+
end
|
|
148
|
+
return -1;
|
|
149
|
+
end
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lua-obfuscator",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc && copyfiles -u 1 src/prometheus/**/* dist/",
|
|
9
|
+
"dev": "concurrently \"tsx watch src/\" \"tsc --watch\" \"copyfiles -u 1 src/prometheus/**/* dist/\""
|
|
10
|
+
},
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "^26.0.0",
|
|
17
|
+
"concurrently": "^10.0.3",
|
|
18
|
+
"copyfiles": "^2.4.1",
|
|
19
|
+
"ts-node": "^10.9.2",
|
|
20
|
+
"typescript": "^6.0.3"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"wasmoon": "^1.16.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { LuaFactory } from 'wasmoon'
|
|
2
|
+
import fs from 'fs'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
import { fileURLToPath } from 'url'
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
7
|
+
const prometheusPath = path.join(__dirname, '../dist/prometheus')
|
|
8
|
+
|
|
9
|
+
const factory = new LuaFactory()
|
|
10
|
+
|
|
11
|
+
function mountDirectory(dir: string, prefix: string = '') {
|
|
12
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
|
13
|
+
for (const entry of entries) {
|
|
14
|
+
const fullPath = path.join(dir, entry.name)
|
|
15
|
+
const luaPath = prefix ? `${prefix}/${entry.name}` : entry.name
|
|
16
|
+
if (entry.isDirectory()) {
|
|
17
|
+
mountDirectory(fullPath, luaPath)
|
|
18
|
+
} else if (entry.name.endsWith('.lua')) {
|
|
19
|
+
console.log('mounting:', luaPath)
|
|
20
|
+
factory.mountFile(luaPath, fs.readFileSync(fullPath))
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
mountDirectory(prometheusPath)
|
|
26
|
+
|
|
27
|
+
type PrometheusPreset = 'Minify' | 'Weak' | 'Medium' | 'Strong'
|
|
28
|
+
|
|
29
|
+
interface PrometheusConfig {
|
|
30
|
+
LuaVersion?: 'Lua51' | 'LuaU'
|
|
31
|
+
VarNamePrefix?: string
|
|
32
|
+
NameGenerator?: 'Mangled' | 'MangledShuffled' | 'Il' | 'Number'
|
|
33
|
+
PrettyPrint?: boolean
|
|
34
|
+
Seed?: number
|
|
35
|
+
Steps: Array<{ Name: string; [key: string]: unknown }>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function obfuscate(
|
|
39
|
+
text: string,
|
|
40
|
+
config: PrometheusPreset | PrometheusConfig = 'Strong'
|
|
41
|
+
): Promise<string> {
|
|
42
|
+
const lua = await factory.createEngine()
|
|
43
|
+
try {
|
|
44
|
+
await lua.doString(`arg = {}`)
|
|
45
|
+
lua.global.set('__input_code', text)
|
|
46
|
+
|
|
47
|
+
let configExpr: string
|
|
48
|
+
if (typeof config === 'string') {
|
|
49
|
+
lua.global.set('__preset_name', config)
|
|
50
|
+
configExpr = 'Prometheus.Presets[__preset_name]'
|
|
51
|
+
} else {
|
|
52
|
+
lua.global.set('__custom_config', config)
|
|
53
|
+
configExpr = '__custom_config'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const obfuscated = await lua.doString(`
|
|
57
|
+
local Prometheus = require("src.prometheus")
|
|
58
|
+
Prometheus.Logger.logLevel = Prometheus.Logger.LogLevel.Error
|
|
59
|
+
|
|
60
|
+
local cfg = ${configExpr}
|
|
61
|
+
if cfg == nil then
|
|
62
|
+
error("Invalid preset or config")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
local pipeline = Prometheus.Pipeline:fromConfig(cfg)
|
|
66
|
+
local result = pipeline:apply(__input_code)
|
|
67
|
+
return result
|
|
68
|
+
`)
|
|
69
|
+
if (typeof obfuscated !== 'string') {
|
|
70
|
+
throw new Error('Prometheus returned invalid result')
|
|
71
|
+
}
|
|
72
|
+
return obfuscated
|
|
73
|
+
} finally {
|
|
74
|
+
lua.global.close()
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
root: ./doc/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: "[BUG]"
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**Expected behavior**
|
|
14
|
+
A clear and concise description of what you expected to happen.
|
|
15
|
+
|
|
16
|
+
**To Reproduce**
|
|
17
|
+
Steps to reproduce the behavior:
|
|
18
|
+
|
|
19
|
+
If your problem is a non-working obfuscated file, please also include a minimal source code example, your config file as well as the output file that you got.
|
|
20
|
+
|
|
21
|
+
**Screenshots**
|
|
22
|
+
If applicable, add screenshots to help explain your problem.
|
|
23
|
+
|
|
24
|
+
**Additional context**
|
|
25
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: windows-latest # gh-actions-lua doesn't work on windows
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout repo
|
|
13
|
+
uses: actions/checkout@master
|
|
14
|
+
- name: Download srlua-mingw
|
|
15
|
+
run: curl -o srlua.zip "https://raw.githubusercontent.com/joedf/LuaBuilds/gh-pages/hdata/srlua-5.1.5_Win32_bin.zip"
|
|
16
|
+
- name: Unzip srlua-mingw
|
|
17
|
+
run: |
|
|
18
|
+
tar -xf srlua.zip
|
|
19
|
+
Rename-Item -Path srglue.exe -NewName glue.exe
|
|
20
|
+
- name: Download Lua53
|
|
21
|
+
run: curl -o Lua53.zip "https://raw.githubusercontent.com/joedf/LuaBuilds/gh-pages/hdata/lua-5.3.5_Win64_bin.zip"
|
|
22
|
+
- name: Unzip Lua53
|
|
23
|
+
run: |
|
|
24
|
+
tar -xf Lua53.zip
|
|
25
|
+
- run: dir
|
|
26
|
+
- name: Build the project
|
|
27
|
+
run: |
|
|
28
|
+
./build.bat
|
|
29
|
+
shell: bash
|
|
30
|
+
- name: Zip the build
|
|
31
|
+
uses: papeloto/action-zip@v1
|
|
32
|
+
with:
|
|
33
|
+
files: build/
|
|
34
|
+
dest: build.zip
|
|
35
|
+
- name: Load version and name
|
|
36
|
+
run: | # I have no idea why but 5.1 just won't work for some reason
|
|
37
|
+
echo "prometheus_full_version=$(./lua.exe ./src/config.lua --FullVersion)" >> $GITHUB_ENV
|
|
38
|
+
echo "prometheus_version=$(./lua.exe ./src/config.lua --Version)" >> $GITHUB_ENV
|
|
39
|
+
shell: bash
|
|
40
|
+
- name: Upload binaries to release
|
|
41
|
+
uses: svenstaro/upload-release-action@v2
|
|
42
|
+
with:
|
|
43
|
+
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
44
|
+
file: build.zip
|
|
45
|
+
asset_name: ${{ env.prometheus_full_version }}.zip
|
|
46
|
+
tag: release-${{ github.ref }}-${{ env.prometheus_version }}
|
|
47
|
+
release_name: ${{ env.prometheus_version }}
|
|
48
|
+
overwrite: true
|
|
49
|
+
body: ${{ env.prometheus_full_version }} ${{ github.event.commits[0].message }}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test-linux:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout repo
|
|
13
|
+
uses: actions/checkout@master
|
|
14
|
+
- name: Install Lua
|
|
15
|
+
uses: leafo/gh-actions-lua@master
|
|
16
|
+
with:
|
|
17
|
+
luaVersion: 5.1
|
|
18
|
+
- name: Run test case
|
|
19
|
+
run: lua ./tests.lua --Linux --CI
|