Skip to content

Commit 9d65db1

Browse files
authored
chore: add GitHub Actions CI/CD, luacheck, and BigWigs packager (#5)
* chore: add GitHub Actions CI/CD, luacheck, and BigWigs packager * chore: add pull request template
1 parent 1a39567 commit 9d65db1

7 files changed

Lines changed: 143 additions & 9 deletions

File tree

.github/pull_request_template.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Summary of Changes
2+
3+
4+
5+
# Testing
6+
7+
_Describe how to verify this in-game, or note if the change is non-functional (CI, data, docs)._
8+
9+
10+
11+
# Checklist
12+
13+
- [ ] Tested in-game on Midnight (Interface 120001)
14+
- [ ] No new global variables introduced (or `.luacheckrc` updated if needed)
15+
- [ ] No taint-unsafe patterns introduced (no runtime `CreateFrame`, `SetParent`, or `SetScript` on secure frames)
16+
- [ ] `Data.lua` spell entries include both `duration` and `defaultDuration`
17+
- [ ] New dev-only files added to `.pkgmeta` ignore list
18+
- [ ] `## Version:` in `CooldownTracker.toc` bumped if this is a release

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*"
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Run Luacheck
20+
uses: nebularg/actions-luacheck@v1
21+
with:
22+
annotate: warning
23+
24+
- name: Package and Release
25+
if: startsWith(github.ref, 'refs/tags/')
26+
uses: BigWigsMods/packager@v2
27+
env:
28+
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.release/
2+
*.zip

.luacheckrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
std = "lua51"
2+
max_line_length = false
3+
4+
-- Globals set by this addon
5+
globals = {
6+
"CooldownTrackerDB",
7+
"SLASH_COOLDOWNTRACKER1",
8+
"SLASH_COOLDOWNTRACKER2",
9+
}
10+
11+
-- WoW API globals (read-only from this addon's perspective)
12+
read_globals = {
13+
-- Core API
14+
"CreateFrame",
15+
"GetTime",
16+
"PlaySound",
17+
-- Constants & tables
18+
"SOUNDKIT",
19+
"UIParent",
20+
"GameTooltip",
21+
"SlashCmdList",
22+
-- Namespaces
23+
"C_Timer",
24+
"Settings",
25+
}

.pkgmeta

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package-as: CooldownTracker
2+
3+
ignore:
4+
- .github
5+
- .gitignore
6+
- .luacheckrc
7+
- .pkgmeta
8+
- AGENTS.md

AGENTS.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,33 @@ The addon is split into modular components, sharing a single private namespace (
1212
- `UI.lua`: Handles rendering the main tracker window, row layouts (grid vs vertical), and the per-frame `OnUpdate` timer loop.
1313
- `Settings.lua`: Implements the in-game options panel (Escape -> Options -> AddOns) using the modern `Settings` API. Handles SavedVariables overrides.
1414
- `Core.lua`: The bootstrap file. Handles `ADDON_LOADED`, slash commands (`/cdt`), and initializes the UI and Settings.
15+
- `.github/workflows/release.yml`: GitHub Actions CI/CD workflow (see CI/CD section below).
16+
- `.luacheckrc`: Luacheck static analysis configuration.
17+
- `.pkgmeta`: BigWigs packager metadata for release packaging.
18+
19+
## 🔁 CI/CD
20+
The project uses GitHub Actions for linting and release packaging.
21+
22+
### Workflow (`.github/workflows/release.yml`)
23+
- **Push to `main`:** Runs `luacheck` on all Lua files via `nebularg/actions-luacheck@v1`.
24+
- **Push a `v*` tag:** Runs luacheck, then runs `BigWigsMods/packager@v2` which creates a GitHub Release with the addon zip attached. Uses the built-in `GITHUB_TOKEN` — no additional secrets required.
25+
26+
### Luacheck (`.luacheckrc`)
27+
- `std = "lua51"` covers standard Lua globals.
28+
- WoW API globals (`CreateFrame`, `GetTime`, `C_Timer`, `Settings`, etc.) are declared in `read_globals`.
29+
- Addon-owned globals (`CooldownTrackerDB`, slash command vars) are declared in `globals`.
30+
- **When adding new WoW API calls:** if luacheck starts reporting an undefined global, add it to `read_globals` in `.luacheckrc`.
31+
32+
### Packager (`.pkgmeta`)
33+
- Dev-only files (`AGENTS.md`, `.github/`, `.luacheckrc`, `.gitignore`) are listed under `ignore` so they are excluded from the release zip.
34+
- **When adding new dev-only files** (e.g. test scripts, editor config), add them to the `ignore` list in `.pkgmeta`.
35+
36+
### Releasing
37+
```bash
38+
git tag -a v1.2.0 -m "Version 1.2.0"
39+
git push origin v1.2.0
40+
```
41+
Also update `## Version:` in `CooldownTracker.toc` to match the tag before tagging.
1542

1643
## 📜 Coding Standards & Conventions
1744
1. **Private Namespace:** Always use the addon's private namespace passed by the WoW client on load. Do not pollute the global environment.

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ Because Midnight restricts addons from reading real-time combat data, this addon
1818

1919
## Installation
2020

21-
1. Copy the `CooldownTracker` folder into:
21+
### Download a release
22+
23+
1. Go to the [Releases](../../releases) page and download the latest `CooldownTracker-*.zip`.
24+
2. Unzip and copy the `CooldownTracker` folder into:
2225
```
2326
World of Warcraft\_retail_\Interface\AddOns\CooldownTracker\
2427
```
25-
2. Launch WoW and enable **Healer Cooldown Tracker** in the AddOns list.
28+
3. Launch WoW and enable **Healer Cooldown Tracker** in the AddOns list.
29+
30+
### From source
31+
32+
Clone the repo and symlink (or copy) the folder directly into your AddOns directory.
2633

2734
## Usage
2835

@@ -70,15 +77,34 @@ No other file needs to change.
7077

7178
```
7279
CooldownTracker/
73-
├── CooldownTracker.toc — Addon manifest & metadata
74-
├── Data.lua — Cooldown definitions (edit this to add abilities)
75-
├── UI.lua — Frame, row widgets, timer rendering
76-
├── Settings.lua — In-game options panel
77-
├── Core.lua — Init, events, slash commands
78-
├── AGENTS.md — AI agent coding guidelines
79-
└── README.md — This file
80+
├── CooldownTracker.toc — Addon manifest & metadata
81+
├── Data.lua — Cooldown definitions (edit this to add abilities)
82+
├── UI.lua — Frame, row widgets, timer rendering
83+
├── Settings.lua — In-game options panel
84+
├── Core.lua — Init, events, slash commands
85+
├── .github/workflows/release.yml — CI: luacheck on push, package+release on tag
86+
├── .luacheckrc — Luacheck config (WoW globals whitelist)
87+
├── .pkgmeta — BigWigs packager metadata
88+
├── AGENTS.md — AI agent coding guidelines
89+
└── README.md — This file
90+
```
91+
92+
## Releases & CI
93+
94+
Releases are built automatically by GitHub Actions using the [BigWigs packager](https://github.com/BigWigsMods/packager).
95+
96+
- **Push to `main`** — runs [luacheck](https://github.com/mpeterv/luacheck) static analysis on all Lua files.
97+
- **Push a version tag** — runs luacheck, packages the addon, and publishes a GitHub Release with a downloadable zip.
98+
99+
To ship a release:
100+
101+
```bash
102+
git tag -a v1.2.0 -m "Version 1.2.0"
103+
git push origin v1.2.0
80104
```
81105

106+
The zip will appear on the [Releases](../../releases) page within a minute or two.
107+
82108
## Compatibility
83109

84110
Tested on **World of Warcraft: Midnight** (Interface 120001). Fully compliant with Midnight's addon restrictions — no combat log reading, no addon messaging.

0 commit comments

Comments
 (0)