diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 00000000..ba3ba9b1 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,32 @@ +name: Development pipeline + +on: + push: + branches: + - "*" + - "!feature/" + +jobs: + release: + name: Publish development build to CDN + runs-on: ubuntu-latest + env: + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + steps: + - name: Clone project + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Workaround checkout issues + run: | + git fetch --tags --force + - name: Create Package + uses: BigWigsMods/packager@v2 + with: + args: -n "{package-name}-$GITHUB_REF_NAME-{project-version}" + - name: Get package name + run: | + echo "PACKAGE=$(find .release -type f -name *.zip -printf "%f\n")" >> $GITHUB_ENV + - name: Publish package + run: | + curl https://api.tukui.org/v1/upload/dev/$PACKAGE --upload-file .release/$PACKAGE -H "X-Tukui-Key: $DEPLOY_KEY" -H "Content-Type: application/zip" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d78157a..7e7b7fd4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,9 +14,18 @@ jobs: steps: - name: Clone project uses: actions/checkout@v4 - - name: Prepare package + with: + fetch-depth: 0 + - name: Workaround checkout issues run: | - zip -9 -r tukui-$VERSION.zip Tukui + git fetch --tags --force + - name: Create Package + uses: BigWigsMods/packager@v2 + with: + args: -n "{package-name}-{project-version}" + - name: Get package name + run: | + echo "PACKAGE=$(find .release -type f -name *.zip -printf "%f\n")" >> $GITHUB_ENV - name: Publish package run: | - curl https://api.tukui.org/v1/upload/tukui-$GITHUB_REF_NAME.zip --upload-file tukui-$GITHUB_REF_NAME.zip -H "X-Tukui-Key: $DEPLOY_KEY" -H "Content-Type: application/zip" + curl https://api.tukui.org/v1/upload/$PACKAGE --upload-file .release/$PACKAGE -H "X-Tukui-Key: $DEPLOY_KEY" -H "Content-Type: application/zip" diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b18906bb --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +Thumbs.db +Desktop.ini +.DS_Store +.vscode + +# Libraries +Tukui/Libs/* +!Tukui/Libs/LibAnim +!Tukui/Libs/LibDeflate +!Tukui/Libs/LibHealComm-4.0 +!Tukui/Libs/LibSerialize +!Tukui/Libs/oUF +!Tukui/Libs/oUF_ArcaneCharge +!Tukui/Libs/oUF_Atonement +!Tukui/Libs/oUF_AuraBars +!Tukui/Libs/oUF_AuraTrack +!Tukui/Libs/oUF_CombatFeedback +!Tukui/Libs/oUF_ComboPointsBar +!Tukui/Libs/oUF_DruidMana +!Tukui/Libs/oUF_EnergyManaRegen +!Tukui/Libs/oUF_FloatingCombatFeedback +!Tukui/Libs/oUF_HarmonyBar +!Tukui/Libs/oUF_HolyPowerBar +!Tukui/Libs/oUF_QuestIcon +!Tukui/Libs/oUF_RaidDebuffs +!Tukui/Libs/oUF_Retail +!Tukui/Libs/oUF_SoulShards +!Tukui/Libs/oUF_Trinkets + +# Pipelines +.release diff --git a/.pkgmeta b/.pkgmeta new file mode 100644 index 00000000..ddc0f23e --- /dev/null +++ b/.pkgmeta @@ -0,0 +1,31 @@ +package-as: Tukui + +externals: + Tukui/Libs/CallbackHandler-1.0: https://repos.curseforge.com/wow/callbackhandler/trunk/CallbackHandler-1.0 + Tukui/Libs/LibStub: https://repos.curseforge.com/wow/libstub/trunk + Tukui/Libs/SortBags: https://github.com/shirsig/SortBags + Tukui/Libs/SortBags_Vanilla: https://github.com/shirsig/SortBags-vanilla + Tukui/Libs/TaintLess: + url: https://www.townlong-yak.com/addons.git/taintless + commit: default + +manual-changelog: + filename: CHANGELOG.md + markup-type: markdown + +ignore: + - "*.md" + - "*.textile" + - Tukui/Libs/LibStub/tests + +plain-copy: + - Tukui/Config + - Tukui/Core + - Tukui/Licenses + - Tukui/Locales + - Tukui/Medias + - Tukui/Modules + - Tukui/Themes + +move-folders: + Tukui/Tukui: Tukui diff --git a/Tukui/Core/Init.lua b/Tukui/Core/Init.lua index 972c490f..c53a7a20 100644 --- a/Tukui/Core/Init.lua +++ b/Tukui/Core/Init.lua @@ -15,6 +15,17 @@ Engine[2] = {} Engine[3] = {} Engine[4] = {} +local function ParseVersionString() + local version = strsub(GetAddOnMetadata(AddOn, 'Version'), 2) + if not strfind(version, '%-') then + return tonumber(version), version + elseif strfind(version, 'project%-version') then + return 99999, 'Development' + else + return 99999, version + end +end + function Engine:unpack() return self[1], self[2], self[3], self[4] end @@ -36,15 +47,13 @@ Engine[1].MyLevel = UnitLevel("player") Engine[1].MyFaction = select(2, UnitFactionGroup("player")) Engine[1].MyRace = select(2, UnitRace("player")) Engine[1].MyRealm = GetRealmName() -Engine[1].Version = GetAddOnMetadata(AddOn, "Version") -Engine[1].VersionNumber = tonumber(Engine[1].Version) +Engine[1].VersionNumber, Engine[1].Version = ParseVersionString() Engine[1].WoWPatch, Engine[1].WoWBuild, Engine[1].WoWPatchReleaseDate, Engine[1].TocVersion = GetBuildInfo() Engine[1].WoWBuild = tonumber(Engine[1].WoWBuild) Engine[1].Hider = CreateFrame("Frame", "TukuiHider", UIParent) Engine[1].PetHider = CreateFrame("Frame", "TukuiPetHider", UIParent, "SecureHandlerStateTemplate") Engine[1].OffScreen = CreateFrame("Frame", "TukuiOffScreen", UIParent) - SLASH_RELOADUI1 = "/rl" SlashCmdList.RELOADUI = ReloadUI diff --git a/Tukui/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua b/Tukui/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua deleted file mode 100644 index 39e265d0..00000000 --- a/Tukui/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua +++ /dev/null @@ -1,212 +0,0 @@ ---[[ $Id: CallbackHandler-1.0.lua 22 2018-07-21 14:17:22Z nevcairiel $ ]] -local MAJOR, MINOR = "CallbackHandler-1.0", 7 -local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) - -if not CallbackHandler then return end -- No upgrade needed - -local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end} - --- Lua APIs -local tconcat = table.concat -local assert, error, loadstring = assert, error, loadstring -local setmetatable, rawset, rawget = setmetatable, rawset, rawget -local next, select, pairs, type, tostring = next, select, pairs, type, tostring - --- Global vars/functions that we don't upvalue since they might get hooked, or upgraded --- List them here for Mikk's FindGlobals script --- GLOBALS: geterrorhandler - -local xpcall = xpcall - -local function errorhandler(err) - return geterrorhandler()(err) -end - -local function Dispatch(handlers, ...) - local index, method = next(handlers) - if not method then return end - repeat - xpcall(method, errorhandler, ...) - index, method = next(handlers, index) - until not method -end - --------------------------------------------------------------------------- --- CallbackHandler:New --- --- target - target object to embed public APIs in --- RegisterName - name of the callback registration API, default "RegisterCallback" --- UnregisterName - name of the callback unregistration API, default "UnregisterCallback" --- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API. - -function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName) - - RegisterName = RegisterName or "RegisterCallback" - UnregisterName = UnregisterName or "UnregisterCallback" - if UnregisterAllName==nil then -- false is used to indicate "don't want this method" - UnregisterAllName = "UnregisterAllCallbacks" - end - - -- we declare all objects and exported APIs inside this closure to quickly gain access - -- to e.g. function names, the "target" parameter, etc - - - -- Create the registry object - local events = setmetatable({}, meta) - local registry = { recurse=0, events=events } - - -- registry:Fire() - fires the given event/message into the registry - function registry:Fire(eventname, ...) - if not rawget(events, eventname) or not next(events[eventname]) then return end - local oldrecurse = registry.recurse - registry.recurse = oldrecurse + 1 - - Dispatch(events[eventname], eventname, ...) - - registry.recurse = oldrecurse - - if registry.insertQueue and oldrecurse==0 then - -- Something in one of our callbacks wanted to register more callbacks; they got queued - for eventname,callbacks in pairs(registry.insertQueue) do - local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. - for self,func in pairs(callbacks) do - events[eventname][self] = func - -- fire OnUsed callback? - if first and registry.OnUsed then - registry.OnUsed(registry, target, eventname) - first = nil - end - end - end - registry.insertQueue = nil - end - end - - -- Registration of a callback, handles: - -- self["method"], leads to self["method"](self, ...) - -- self with function ref, leads to functionref(...) - -- "addonId" (instead of self) with function ref, leads to functionref(...) - -- all with an optional arg, which, if present, gets passed as first argument (after self if present) - target[RegisterName] = function(self, eventname, method, ... --[[actually just a single arg]]) - if type(eventname) ~= "string" then - error("Usage: "..RegisterName.."(eventname, method[, arg]): 'eventname' - string expected.", 2) - end - - method = method or eventname - - local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. - - if type(method) ~= "string" and type(method) ~= "function" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - string or function expected.", 2) - end - - local regfunc - - if type(method) == "string" then - -- self["method"] calling style - if type(self) ~= "table" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): self was not a table?", 2) - elseif self==target then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): do not use Library:"..RegisterName.."(), use your own 'self'", 2) - elseif type(self[method]) ~= "function" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - method '"..tostring(method).."' not found on self.", 2) - end - - if select("#",...)>=1 then -- this is not the same as testing for arg==nil! - local arg=select(1,...) - regfunc = function(...) self[method](self,arg,...) end - else - regfunc = function(...) self[method](self,...) end - end - else - -- function ref with self=object or self="addonId" or self=thread - if type(self)~="table" and type(self)~="string" and type(self)~="thread" then - error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string or thread expected.", 2) - end - - if select("#",...)>=1 then -- this is not the same as testing for arg==nil! - local arg=select(1,...) - regfunc = function(...) method(arg,...) end - else - regfunc = method - end - end - - - if events[eventname][self] or registry.recurse<1 then - -- if registry.recurse<1 then - -- we're overwriting an existing entry, or not currently recursing. just set it. - events[eventname][self] = regfunc - -- fire OnUsed callback? - if registry.OnUsed and first then - registry.OnUsed(registry, target, eventname) - end - else - -- we're currently processing a callback in this registry, so delay the registration of this new entry! - -- yes, we're a bit wasteful on garbage, but this is a fringe case, so we're picking low implementation overhead over garbage efficiency - registry.insertQueue = registry.insertQueue or setmetatable({},meta) - registry.insertQueue[eventname][self] = regfunc - end - end - - -- Unregister a callback - target[UnregisterName] = function(self, eventname) - if not self or self==target then - error("Usage: "..UnregisterName.."(eventname): bad 'self'", 2) - end - if type(eventname) ~= "string" then - error("Usage: "..UnregisterName.."(eventname): 'eventname' - string expected.", 2) - end - if rawget(events, eventname) and events[eventname][self] then - events[eventname][self] = nil - -- Fire OnUnused callback? - if registry.OnUnused and not next(events[eventname]) then - registry.OnUnused(registry, target, eventname) - end - end - if registry.insertQueue and rawget(registry.insertQueue, eventname) and registry.insertQueue[eventname][self] then - registry.insertQueue[eventname][self] = nil - end - end - - -- OPTIONAL: Unregister all callbacks for given selfs/addonIds - if UnregisterAllName then - target[UnregisterAllName] = function(...) - if select("#",...)<1 then - error("Usage: "..UnregisterAllName.."([whatFor]): missing 'self' or \"addonId\" to unregister events for.", 2) - end - if select("#",...)==1 and ...==target then - error("Usage: "..UnregisterAllName.."([whatFor]): supply a meaningful 'self' or \"addonId\"", 2) - end - - - for i=1,select("#",...) do - local self = select(i,...) - if registry.insertQueue then - for eventname, callbacks in pairs(registry.insertQueue) do - if callbacks[self] then - callbacks[self] = nil - end - end - end - for eventname, callbacks in pairs(events) do - if callbacks[self] then - callbacks[self] = nil - -- Fire OnUnused callback? - if registry.OnUnused and not next(callbacks) then - registry.OnUnused(registry, target, eventname) - end - end - end - end - end - end - - return registry -end - - --- CallbackHandler purposefully does NOT do explicit embedding. Nor does it --- try to upgrade old implicit embeds since the system is selfcontained and --- relies on closures to work. - diff --git a/Tukui/Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml b/Tukui/Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml deleted file mode 100644 index 876df83a..00000000 --- a/Tukui/Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/bug-report.md b/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index 37c22078..00000000 --- a/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Bug report -about: Create a report of an issue you've found -title: '' -labels: bug - ---- - -**Describe the bug** - - -**How to reproduce** - - -**What did you expect?** - - -**Error report** - -``` -``` - -**Screenshots** - diff --git a/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/config.yml b/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 0c2169d2..00000000 --- a/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Question - url: https://www.wowinterface.com/forums/forumdisplay.php?f=87 - about: Please ask and answer questions in the oUF section on wowinterface.com diff --git a/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/feature_request.md b/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index afe02b1f..00000000 --- a/Tukui/Libs/oUF/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: Feature request -about: Suggest a new idea that would improve this addon -title: '' -labels: enhancement - ---- - -**Describe the solution you'd like** - - -**Describe alternatives you've considered** - diff --git a/Tukui/Libs/oUF/.github/workflows/release.yml b/Tukui/Libs/oUF/.github/workflows/release.yml deleted file mode 100644 index 50306936..00000000 --- a/Tukui/Libs/oUF/.github/workflows/release.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Package and release -on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Clone project - uses: actions/checkout@v2 - with: - # this fetches everything, we'll need it to generate changelogs - fetch-depth: 0 - - - name: Install Lua - run: | - # apt-get commands - echo '::group::apt update' - sudo apt-get -qq update - echo '::endgroup::' - echo '::group::apt install lua 5.1' - sudo apt-get install -qq lua5.1 - echo '::endgroup::' - - - name: Generate changelog - run: | - lua utils/changelog > CHANGELOG.md - - - name: Package and release - uses: BigWigsMods/packager@cd13fb1 - env: - CF_API_KEY: ${{ secrets.CF_API_KEY }} - WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }} diff --git a/Tukui/Libs/oUF/.pkgmeta b/Tukui/Libs/oUF/.pkgmeta deleted file mode 100644 index 220b0d48..00000000 --- a/Tukui/Libs/oUF/.pkgmeta +++ /dev/null @@ -1,11 +0,0 @@ -package-as: oUF - -manual-changelog: - filename: CHANGELOG.md - markup-type: markdown - -optional-dependencies: - - clique - -ignore: - - utils diff --git a/Tukui/Libs/oUF/README.md b/Tukui/Libs/oUF/README.md deleted file mode 100644 index cdfcfbc8..00000000 --- a/Tukui/Libs/oUF/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# oUF - -## Download - -- [WoWInterface](https://www.wowinterface.com/downloads/info9994-oUF.html) -- [CurseForge](https://www.curseforge.com/wow/addons/ouf) - -## Introduction - -oUF is a unit frame framework. -It attempts to simplify the process of writing unit frames for WoW by doing all the trivial and painfully boring parts for you, so you can focus more on experimenting with the look of the frames. - -By itself oUF doesn't do much, a layout is required. - -## Documentation - -All the documentation can be found in the source code (until we publish it online). -If you're upgrading to version 10.0, see our [upgrade guide](https://www.wowinterface.com/forums/showthread.php?t=58257). - -## Embedding - -If you intend to embed oUF into your project, please refer to our [embedding wiki page](https://github.com/oUF-wow/oUF/wiki/Embedding). - -## Feedback - -If you have an issue, please use the [issue tracker](https://github.com/oUF-wow/oUF/issues). Alternatively you can start a topic on our [official forums](https://www.wowinterface.com/forums/forumdisplay.php?f=87). - -Please search first to make sure your issue has not been reported/solved already. -Generally, bugs should be reported through the author of the layout you're using. diff --git a/Tukui/Libs/oUF/oUF.toc b/Tukui/Libs/oUF/oUF.toc deleted file mode 100644 index a6310b44..00000000 --- a/Tukui/Libs/oUF/oUF.toc +++ /dev/null @@ -1,12 +0,0 @@ -## Interface: 90002 -## Title: oUF -## Author: Haste, lightspark, p3lim, Rainrider -## Version: @project-version@ -## Notes: Unit frame framework. Does nothing by itself. -## OptionalDeps: Clique -## X-oUF: oUF - -## X-Curse-Project-ID: 21187 -## X-WoWI-ID: 9994 - -oUF.xml diff --git a/Tukui/Libs/oUF/oUF.xml b/Tukui/Libs/oUF/oUF.xml deleted file mode 100644 index 5e8faf21..00000000 --- a/Tukui/Libs/oUF/oUF.xml +++ /dev/null @@ -1,86 +0,0 @@ - -