Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: upload rockspec to LuaRocks on tag push #106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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:

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