Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: leafo/gh-actions-lua
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v10.0.0
Choose a base ref
...
head repository: leafo/gh-actions-lua
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v11.0.0
Choose a head ref
  • 11 commits
  • 4,196 files changed
  • 4 contributors

Commits on Mar 13, 2024

  1. Fix openresty build on windows

    leso-kn authored and leafo committed Mar 13, 2024
    Copy the full SHA
    044311a View commit details
  2. fix: change www.lua.org to lua.org to reflect certificate change

    Looks like https://lua.org/ 's certificate changed today.
    
    ```text
    * Server certificate:                                                                                                                                                       *  subject: CN=lua.org                                                                                                                                                      *  start date: Dec 20 17:54:42 2023 GMT
    *  expire date: Mar 19 17:54:41 2024 GMT
    *  subjectAltName: host "lua.org" matched cert's "lua.org"
    *  issuer: C=US; O=Let's Encrypt; CN=R3
    *  SSL certificate verify ok.
    ```
    
    ```text
    Run leafo/gh-actions-lua@v10
      with:
        luaVersion: 5.4
        buildCache: true
    Notice: gh-actions-lua: No cache available, clean build
    Hostname/IP does not match certificate's altnames: Host: www.lua.org. is not in the cert's altnames: DNS:lua.org
    Waiting 18 seconds before trying again
    Hostname/IP does not match certificate's altnames: Host: www.lua.org. is not in the cert's altnames: DNS:lua.org
    Waiting 1[6](https://github.com/vpayno/exercism-workspace/actions/runs/7284425228/job/19849762432?pr=323#step:3:7) seconds before trying again
    Error: Failed to install
    ```
    vpayno authored and leafo committed Mar 13, 2024
    Copy the full SHA
    139389f View commit details
  3. Fix symlink creation under luajit-openresty

    leso-kn authored and leafo committed Mar 13, 2024
    Copy the full SHA
    ef92399 View commit details

Commits on Feb 27, 2025

  1. update to node20

    leafo committed Feb 27, 2025
    Copy the full SHA
    33d9166 View commit details
  2. Fix C module loading on windows

    leso-kn authored and leafo committed Feb 27, 2025
    Copy the full SHA
    b1670dd View commit details
  3. Download LuaJIT rolling release from git

    As requested by luajit.org: https://luajit.org/download.html
    hishamhm authored and leafo committed Feb 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6cb5f17 View commit details
  4. CI: add more supported configurations

    hishamhm authored and leafo committed Feb 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0bb1f4c View commit details
  5. latest PUC Lua is 5.4.7

    hishamhm authored and leafo committed Feb 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    19803cc View commit details
  6. luajit: Copy Windows library to lib as well

    hishamhm authored and leafo committed Feb 27, 2025
    Copy the full SHA
    fbf9be8 View commit details
  7. update @actions dependencies

    leafo committed Feb 27, 2025
    Copy the full SHA
    045fb71 View commit details
  8. update versions in readme

    leafo committed Feb 27, 2025
    Copy the full SHA
    8aace34 View commit details
Showing 4,196 changed files with 147,179 additions and 164,071 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 20 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -7,8 +7,17 @@ jobs:
strategy:
fail-fast: false
matrix:
luaVersion: ["5.1.5", "5.2.4", "5.3.6", "5.4.4", "luajit-2.0.5", "luajit-2.1.0-beta3", "luajit-openresty", "5.1", "5.4"]
luaVersion: ["5.1.5", "5.2.4", "5.3.6", "5.4.4", "luajit", "luajit-2.0", "luajit-2.1", "luajit-2.0.5", "luajit-2.1.0-beta3", "luajit-openresty", "5.1", "5.4"]
machineTag: ["ubuntu-latest", "macos-latest", "windows-latest"]
exclude:
- luaVersion: "luajit-2.0"
machineTag: "macos-latest"
- luaVersion: "luajit-2.0.5"
machineTag: "macos-latest"
- luaVersion: "luajit-2.0.5"
machineTag: "windows-latest"
- luaVersion: "luajit-2.1.0-beta3"
machineTag: "windows-latest"

runs-on: ${{ matrix.machineTag }}

@@ -32,8 +41,17 @@ jobs:
strategy:
fail-fast: false
matrix:
luaVersion: ["5.1.5", "5.2.4", "5.3.6", "5.4.4", "luajit-2.0.5", "luajit-2.1.0-beta3", "luajit-openresty", "5.1", "5.4"]
luaVersion: ["5.1.5", "5.2.4", "5.3.6", "5.4.4", "luajit", "luajit-2.0", "luajit-2.1", "luajit-2.0.5", "luajit-2.1.0-beta3", "luajit-openresty", "5.1", "5.4"]
machineTag: ["ubuntu-latest", "macos-latest", "windows-latest"]
exclude:
- luaVersion: "luajit-2.0"
machineTag: "macos-latest"
- luaVersion: "luajit-2.0.5"
machineTag: "macos-latest"
- luaVersion: "luajit-2.0.5"
machineTag: "windows-latest"
- luaVersion: "luajit-2.1.0-beta3"
machineTag: "windows-latest"

runs-on: ${{ matrix.machineTag }}

21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -22,21 +22,21 @@ Other Lua GitHub actions:
Install Lua: (Will typically default to the latest release, 5.4.4 as of this readme)

```yaml
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-lua@v11
```
Install specific version of Lua:
```yaml
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-lua@v11
with:
luaVersion: "5.1.5"
```
Install specific version of LuaJIT:
```yaml
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-lua@v11
with:
luaVersion: "luajit-2.1.0-beta3"
```
@@ -47,7 +47,7 @@ include this line on non-Windows platforms, as the action will do nothing in tho

```yaml
- uses: ilammy/msvc-dev-cmd@v1
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-lua@v11
```

## Inputs
@@ -65,14 +65,15 @@ Examples of versions:
* `"5.2.4"`
* `"5.3.5"`
* `"5.4.1"`
* `"luajit-2.0.5"`
* `"luajit-2.1.0-beta3"`
* `"luajit-2.0"`
* `"luajit-2.1"`
* `"luajit-master"`
* `"luajit-openresty"`

The version specifies where the source is downloaded from:

* `luajit-openresty` — will allways pull master from https://github.com/openresty/luajit2
* Anything starting with `luajit-` — from http://luajit.org/download.html
* `luajit-openresty` — will always pull master from https://github.com/openresty/luajit2
* Anything else starting with `luajit-` — pulls a master or version branch from https://github.com/luajit/luajit
* Anything else — from https://www.lua.org/ftp/

**Version aliases**
@@ -116,7 +117,7 @@ jobs:
steps:
- uses: actions/checkout@master
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-lua@v11
with:
luaVersion: "5.1.5"
@@ -153,7 +154,7 @@ jobs:
steps:
- uses: actions/checkout@master
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-lua@v11
with:
luaVersion: ${{ matrix.luaVersion }}
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -20,5 +20,5 @@ inputs:
default: 'true'

runs:
using: 'node16'
main: 'main.js'
using: 'node20'
main: 'main.js'
105 changes: 57 additions & 48 deletions main.js
Original file line number Diff line number Diff line change
@@ -18,8 +18,36 @@ const VERSION_ALIASES = {
"5.1": "5.1.5",
"5.2": "5.2.4",
"5.3": "5.3.6",
"5.4": "5.4.4",
"luajit": "luajit-2.1.0-beta3",
"5.4": "5.4.7",
"luajit": "luajit-2.1",
}

const LUAJIT_REPOS = {
"luajit-2.0": {
"url": "https://github.com/luajit/luajit.git",
"branch": "v2.0",
"binary": "luajit"
},
"luajit-2.1": {
"url": "https://github.com/luajit/luajit.git",
"branch": "v2.1",
"binary": "luajit"
},
"luajit-2.1.0-beta3": {
"url": "https://github.com/luajit/luajit.git",
"branch": "v2.1.0-beta3",
"binary": "luajit-2.1.0-beta3"
},
"luajit-master": {
"url": "https://github.com/luajit/luajit.git",
"branch": "master",
"binary": "luajit"
},
"luajit-openresty": {
"url": "https://github.com/openresty/luajit2.git",
"branch": "v2.1-agentzh",
"binary": "luajit"
},
}

const isMacOS = () => (process.platform || "").startsWith("darwin")
@@ -38,6 +66,7 @@ const processCwd = () => {
async function finish_luajit_install(src, dst, luajit) {
if (isWindows()) {
await fsp.copyFile(pathJoin(src, "lua51.dll"), pathJoin(dst, "bin", "lua51.dll"))
await fsp.copyFile(pathJoin(src, "lua51.dll"), pathJoin(dst, "lib", "lua51.dll"))

await exec.exec(`ln -s ${luajit} lua.exe`, undefined, {
cwd: pathJoin(dst, "bin")
@@ -49,13 +78,27 @@ async function finish_luajit_install(src, dst, luajit) {
}
}

async function install_luajit_openresty(luaInstallPath) {
async function install_luajit(luaInstallPath, luaVersion) {
const luajitVersion = luaVersion.substr("luajit-".length)

let repo = LUAJIT_REPOS[luaVersion];
if (!repo) {
repo = {
"url": LUAJIT_REPOS["luajit-master"].url,
"branch": "v" + luajitVersion,
"binary": "luajit"
}
}

const buildPath = path.join(process.env["RUNNER_TEMP"], BUILD_PREFIX)
const luaCompileFlags = core.getInput('luaCompileFlags')

// "luajit" or "luajit2"
const baseDir = repo.url.match(/.*\/(.*)\.git/)[1]

await io.mkdirP(buildPath)

await exec.exec("git clone https://github.com/openresty/luajit2.git", undefined, {
await exec.exec(`git clone --branch ${repo.branch} --single-branch ${repo.url}`, undefined, {
cwd: buildPath
})

@@ -70,44 +113,15 @@ async function install_luajit_openresty(luaInstallPath) {
}

await exec.exec(`make ${finalCompileFlags}`, undefined, {
cwd: pathJoin(buildPath, "luajit2")
cwd: pathJoin(buildPath, baseDir),
...(isWindows() ? { env: { SHELL: 'cmd' }} : {})
})

await exec.exec(`make -j install PREFIX="${luaInstallPath}"`, undefined, {
cwd: pathJoin(buildPath, "luajit2")
cwd: pathJoin(buildPath, baseDir)
})

await finish_luajit_install(pathJoin(buildPath, "luajit2", "src"), luaInstallPath, "luajit-2.1.0-beta3")
}

async function install_luajit(luaInstallPath, luajitVersion) {
const luaExtractPath = pathJoin(process.env["RUNNER_TEMP"], BUILD_PREFIX, `LuaJIT-${luajitVersion}`)

const luaCompileFlags = core.getInput('luaCompileFlags')

const luaSourceTar = await tc.downloadTool(`https://luajit.org/download/LuaJIT-${luajitVersion}.tar.gz`)
await io.mkdirP(luaExtractPath)
await tc.extractTar(luaSourceTar, path.join(process.env["RUNNER_TEMP"], BUILD_PREFIX))

let finalCompileFlags = "-j"

if (isMacOS()) {
finalCompileFlags += " MACOSX_DEPLOYMENT_TARGET=10.15"
}

if (luaCompileFlags) {
finalCompileFlags += ` ${luaCompileFlags}`
}

await exec.exec(`make ${finalCompileFlags}`, undefined, {
cwd: luaExtractPath
})

await exec.exec(`make -j install PREFIX="${luaInstallPath}"`, undefined, {
cwd: luaExtractPath
})

await finish_luajit_install(pathJoin(luaExtractPath, "src"), luaInstallPath, `luajit-${luajitVersion}`)
await finish_luajit_install(pathJoin(buildPath, baseDir, "src"), luaInstallPath, repo.binary)
}

async function msvc_link(luaExtractPath, linkCmd, outFile, objs) {
@@ -172,21 +186,21 @@ async function install_plain_lua_windows(luaExtractPath, luaInstallPath, luaVers
}
})

objs["lua"] = [ ...objs["lua"], ...objs["lib"] ]
objs["luac"] = [ ...objs["luac"], ...objs["lib"] ]

let luaXYZ = luaVersion.split(".")
let libFile = "lua" + luaXYZ[0] + luaXYZ[1] + ".lib"
let dllFile = "lua" + luaXYZ[0] + luaXYZ[1] + ".dll"

objs["lua"] = [ ...objs["lua"], libFile ]
objs["luac"] = [ ...objs["luac"], ...objs["lib"] ]

await msvc_link(luaExtractPath, "link /nologo /DLL", dllFile, objs["lib"]);
await msvc_link(luaExtractPath, "link /nologo", "luac.exe", objs["luac"]);
await msvc_link(luaExtractPath, "link /nologo", "lua.exe", objs["lua"]);

const luaHpp = (await exists(pathJoin(src, "lua.hpp"))) ? "lua.hpp" : "../etc/lua.hpp"
const headers = [ "lua.h", "luaconf.h", "lualib.h", "lauxlib.h", luaHpp ]

await install_files(pathJoin(luaInstallPath, "bin"), luaExtractPath, [ "lua.exe", "luac.exe" ])
await install_files(pathJoin(luaInstallPath, "bin"), luaExtractPath, [ "lua.exe", "luac.exe", dllFile ])
await install_files(pathJoin(luaInstallPath, "lib"), luaExtractPath, [ dllFile, libFile ])
await install_files(pathJoin(luaInstallPath, "include"), src, headers)
}
@@ -195,7 +209,7 @@ async function install_plain_lua(luaInstallPath, luaVersion) {
const luaExtractPath = pathJoin(process.env["RUNNER_TEMP"], BUILD_PREFIX, `lua-${luaVersion}`)
const luaCompileFlags = core.getInput('luaCompileFlags')

const luaSourceTar = await tc.downloadTool(`https://www.lua.org/ftp/lua-${luaVersion}.tar.gz`)
const luaSourceTar = await tc.downloadTool(`https://lua.org/ftp/lua-${luaVersion}.tar.gz`)
await io.mkdirP(luaExtractPath)
await tc.extractTar(luaSourceTar, path.join(process.env["RUNNER_TEMP"], BUILD_PREFIX))

@@ -230,13 +244,8 @@ async function install_plain_lua(luaInstallPath, luaVersion) {
}

async function install(luaInstallPath, luaVersion) {
if (luaVersion == "luajit-openresty") {
return await install_luajit_openresty(luaInstallPath)
}

if (luaVersion.startsWith("luajit-")) {
const luajitVersion = luaVersion.substr("luajit-".length)
return await install_luajit(luaInstallPath, luajitVersion)
return await install_luajit(luaInstallPath, luaVersion)
}

return await install_plain_lua(luaInstallPath, luaVersion)
1 change: 1 addition & 0 deletions node_modules/.bin/fxparser

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion node_modules/.bin/uuid

This file was deleted.

Loading