Skip to content

Conversation

@luau-project
Copy link

Overview

Since https://github.com/openresty/lua-cjson has become such a core dependency to a huge amount of packages on LuaRocks, this PR adds a new job to the current CI to upload the rockspec to LuaRocks once a new tag is pushed to GitHub.

Description

  • Added a upload job to CI, which uploads the rockspec to LuaRocks once a new tag is pushed to GitHub;

Note

There is a guard to make sure that the GitHub tag matches the rockspec tag (field source.tag), failing the upload job otherwise.

Requeriments

In order to upload rockspecs to LuaRocks, a few steps are required:

  1. Generate an API key to upload rockspecs to LuaRocks:
    1. Visit https://luarocks.org/;
    2. Log in;
    3. Go to Settings;
    4. Generate a new API key and save it to store on a GitHub secret used by the upload job.
  2. Generate a GitHub secret to hold LuaRocks API key:
    1. Visit https://github.com/openresty/lua-cjson;
    2. Log in;
    3. Go to Settings > Secrets and variables > Actions and click New repository secret button;
    4. Paste LUAROCKS_APIKEY into Name field, paste LuaRocks API key generated from LuaRocks in the Secret box, and hit Add secret button.

Important

The secret name must be LUAROCKS_APIKEY, as is defined in the upload job.

Workflow Testing

Visit my fork's workflow runs https://github.com/luau-project/lua-cjson/actions and check how it ran:

@luau-project luau-project deleted the ci-luarocks-upload branch April 25, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

question re: luarocks packaging and releases

2 participants