Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
pull_request:
push:
branches:
- master

jobs:
test:
name: Test - ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 1
strategy:
max-parallel: 1
matrix:
include:
- os: linux
runner: ubuntu-latest
- os: windows
runner: windows-latest
steps:
- uses: actions/checkout@v4

- name: Set up external foreman
run: |
cp foreman-extern.toml foreman.toml

- name: Get foreman and run foreman install
uses: Roblox/setup-foreman@v3
with:
version: "^1.0.0"
token: ${{ secrets.GITHUB_TOKEN }}
allow-external-github-orgs: true

- name: Run tests
env:
LOG_NO_COLOR: 1
ROBLOX_API_KEY: ${{ secrets.ROBLOX_API_KEY }}
TEST_UNIVERSE_ID: ${{ secrets.TEST_UNIVERSE_ID }}
TEST_PLACE_ID: ${{ secrets.TEST_PLACE_ID }}
run: |
lute scripts/test
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
Comment thread
raymondnumbergenerator marked this conversation as resolved.
push:
tags: ["v*.*.*"]

jobs:
Comment thread
raymondnumbergenerator marked this conversation as resolved.
build:
name: Build - ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 1
strategy:
matrix:
include:
- os: macos
runner: macos-latest
artifact_path: "build/rocale-cli"
- os: linux
runner: ubuntu-latest
artifact_path: "build/rocale-cli"
- os: windows
runner: windows-latest
artifact_path: "build/rocale-cli.exe"
steps:
- uses: actions/checkout@v4

- name: Generate access token
uses: Roblox-ActionsCache/tibdex-github-app-token@v1.4.0
id: setup_token
with:
app_id: ${{ secrets.TOKENS_APP_LUA_ECOSYSTEM_DEPENDENCIES_ID }}
private_key: ${{ secrets.TOKENS_APP_LUA_ECOSYSTEM_DEPENDENCIES_KEY }}

- name: Get foreman and run foreman install
uses: Roblox/setup-foreman@v3
with:
version: "^1.0.0"
token: ${{ steps.setup_token.outputs.token }}
allow-external-github-orgs: true

- name: Build release artifacts
run: |
lute scripts/build

- uses: actions/upload-artifact@v5
with:
name: rocale-cli-${{ matrix.os }}-x86_64
path: ${{ matrix.artifact_path }}

release:
runs-on: ubuntu-latest
timeout-minutes: 3
needs: build
steps:
- uses: actions/download-artifact@v5
with:
path: artifacts

- name: Zip release artifacts
run: |
zip -rj rocale-cli-macos-x86_64.zip ./artifacts/rocale-cli-macos-x86_64/*
zip -rj rocale-cli-linux-x86_64.zip ./artifacts/rocale-cli-linux-x86_64/*
zip -rj rocale-cli-windows-x86_64.zip ./artifacts/rocale-cli-windows-x86_64/*

- uses: Roblox-ActionsCache/softprops-action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
files: |
rocale-cli-*.zip
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.DS_Store
build
.env
output.rbxl
6 changes: 6 additions & 0 deletions foreman-extern.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tools]
lute = { source = "luau-lang/lute", version = "=0.1.0-nightly.20251106" }
selene = { source = "Kampfkarren/selene", version = "0.29.0" }
stylua = { source = "JohnnyMorganz/StyLua", version = "2.0.1" }
darklua = { github = "seaofvoices/darklua", version = "=0.17.1" }
rojo = { source = "rojo-rbx/rojo", version = "7.3.0" }
1 change: 1 addition & 0 deletions foreman.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ lute = { source = "luau-lang/lute", version = "=0.1.0-nightly.20251106" }
selene = { source = "Roblox/Kampfkarren-selene", version = "0.29.0" }
stylua = { source = "Roblox/JohnnyMorganz-StyLua", version = "2.0.1" }
darklua = { github = "seaofvoices/darklua", version = "=0.17.1" }
rojo = { source = "Roblox/rojo-rbx-rojo", version = "7.3.0" }
10 changes: 8 additions & 2 deletions scripts/build.luau
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local fs = require("@lute/fs")
local system = require("@lute/system")

local log = require("../src/util/log")
log.setLevel("debug")
Expand All @@ -9,7 +10,12 @@ if not fs.exists("build") then
fs.mkdir("build")
end

local output_path = "build/rocale-cli"
if string.lower(system.os) == "windows_nt" then
output_path = output_path .. ".exe"
end

log.info("Building rocale-cli...")
runProcess({ "darklua", "process", "src/cli.luau", "build/cli.luau" }) -- Remove when lute compile supports aliases
runProcess({ "lute", "compile", "build/cli.luau", "--output", "build/rocale-cli", "--show-require-graph" })
log.info("Build complete: build/rocale-cli")
runProcess({ "lute", "compile", "build/cli.luau", "--output", output_path, "--show-require-graph" })
log.info("Build complete: " .. output_path)
25 changes: 25 additions & 0 deletions scripts/test.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
local process = require("@lute/process")

local log = require("../src/util/log")
log.setLevel("debug")

local runProcess = require("../src/util/runProcess")

runProcess({
"lute",
"scripts/build",
})

runProcess({
"build/rocale-cli",
"run",
"--script",
"tests/run-test-project.luau",
"--placeId",
process.env.TEST_PLACE_ID,
"--universeId",
process.env.TEST_UNIVERSE_ID,
"--load.project",
"tests/test.project.json",
"--verbose",
})
5 changes: 5 additions & 0 deletions src/util/log.luau
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ local log = {}
type Level = "trace" | "debug" | "info" | "warn" | "error"

local currentLevel: Level = "info"

local colorsEnabled = true -- set to false to disable colors
if process.env.LOG_NO_COLOR then
colorsEnabled = false
end

local showCaller = true -- set to false to disable caller information

local levels = {
Expand Down
1 change: 1 addition & 0 deletions tests/project/init.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return true
6 changes: 6 additions & 0 deletions tests/run-test-project.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local TestProject = require(ReplicatedStorage:FindFirstChild("TestProject"))
assert(TestProject == true, "TestProject did not return true")

return
11 changes: 11 additions & 0 deletions tests/test.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "TestProject",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"TestProject": {
"$path": "project"
}
}
}
}