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
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Package release

on:
push:
tags:
- "v*.*.*"

permissions:
contents: write

jobs:
release:
name: Test, package, and draft release
runs-on: ubuntu-latest

steps:
- name: Check out tagged commit
uses: actions/checkout@v6

- name: Install Lua 5.1.5
uses: leafo/gh-actions-lua@v13
with:
luaVersion: "5.1.5"

- name: Install LuaRocks
uses: leafo/gh-actions-luarocks@v6

- name: Install Busted
run: luarocks install busted 2.3.0-1

- name: Derive version from tag
shell: bash
run: |
VERSION="${GITHUB_REF_NAME#v}"
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "PACKAGE=dist/lightroom-llama-v${VERSION}.zip" >> "$GITHUB_ENV"

- name: Build release package
run: make package VERSION="$VERSION"

- name: Create draft GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" "$PACKAGE" \
--verify-tag \
--draft \
--generate-notes \
--title "Lightroom Llama $VERSION"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ luac.out
*.x86_64
*.hex

reference.lrplugin
reference.lrplugin

# Generated release packages
dist/
10 changes: 10 additions & 0 deletions .idea/.gitignore

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

8 changes: 8 additions & 0 deletions .idea/lightroom-llama.iml

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

22 changes: 19 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
.PHONY: test clean
VERSION ?= dev
DIST_DIR := dist
PLUGIN_DIR := lightroom-llama.lrplugin
PACKAGE := $(DIST_DIR)/lightroom-llama-v$(VERSION).zip

.PHONY: test clean package

# Run the Busted unit test suite for plugin modules.
# Delegates to run_tests.sh (the authoritative runner) so flags are only defined once.
# Delegates to run_tests.sh so test flags are defined in one place.
test:
./tests/run_tests.sh

# Remove generated/test artifacts
# Run tests, create the release ZIP, and verify that the archive is valid.
package: test
rm -rf "$(DIST_DIR)"
mkdir -p "$(DIST_DIR)"
zip -r "$(PACKAGE)" "$(PLUGIN_DIR)" \
-x "*/.DS_Store" \
"*/__MACOSX/*" \
"*/._*"
unzip -t "$(PACKAGE)"

# Remove generated test and release artifacts.
clean:
rm -f tests/spec/*.gc* 2>/dev/null || true
rm -rf "$(DIST_DIR)"
Loading