{"id":13412663,"url":"https://github.com/nvim-neorocks/luarocks-tag-release","last_synced_at":"2025-04-09T13:07:49.970Z","repository":{"id":65229722,"uuid":"588524825","full_name":"nvim-neorocks/luarocks-tag-release","owner":"nvim-neorocks","description":"GitHub workflow for automatically generating Luarocks releases from tags and running busted tests","archived":false,"fork":false,"pushed_at":"2024-10-28T05:38:55.000Z","size":640,"stargazers_count":47,"open_issues_count":9,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T22:45:25.538Z","etag":null,"topics":["automation","busted","cicd","luarocks","neovim","release","test","testing","workflow"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvim-neorocks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-13T10:30:53.000Z","updated_at":"2024-10-28T05:38:58.000Z","dependencies_parsed_at":"2024-01-20T08:27:42.553Z","dependency_job_id":"6bf73a1c-1676-4449-bfd5-578dc13205ab","html_url":"https://github.com/nvim-neorocks/luarocks-tag-release","commit_stats":{"total_commits":571,"total_committers":11,"mean_commits":51.90909090909091,"dds":"0.25919439579684767","last_synced_commit":"00462d3eefc116b02d9b1b264aafa4618e0162d3"},"previous_names":["mrcjkb/luarocks-tag-release"],"tags_count":123,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-neorocks%2Fluarocks-tag-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-neorocks%2Fluarocks-tag-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-neorocks%2Fluarocks-tag-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-neorocks%2Fluarocks-tag-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-neorocks","download_url":"https://codeload.github.com/nvim-neorocks/luarocks-tag-release/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247746027,"owners_count":20989116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","busted","cicd","luarocks","neovim","release","test","testing","workflow"],"created_at":"2024-07-30T20:01:27.496Z","updated_at":"2025-04-09T13:07:49.953Z","avatar_url":"https://github.com/nvim-neorocks.png","language":"Lua","funding_links":[],"categories":["Neovim Lua Development"],"sub_categories":["Quickfix"],"readme":"\u003c!-- markdownlint-disable --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/nvim-neorocks/luarocks-tag-release\"\u003e\n    \u003cimg src=\"https://avatars.githubusercontent.com/u/124081866?s=400\u0026u=0da379a468d46456477a1f68048b020cf7a99f34\u0026v=4\" alt=\"neorocks\"\u003e\n  \u003c/a\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/nvim-neorocks/luarocks-tag-release/issues\"\u003eReport Bug\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003cstrong\u003e\n      luarocks-tag-release\n      \u003cbr /\u003e\n      Automatically publish \u003ca href=\"https://luarocks.org/\"\u003eluarocks\u003c/a\u003e packages from git tags.\n      \u003cbr /\u003e\n      Designed to work with \u003ca href=\"https://neovim.io/\"\u003eNeovim\u003c/a\u003e plugins.\n    \u003c/strong\u003e\n  \u003c/p\u003e\n  \u003cp\u003e🏷️🚀🌒\u003c/p\u003e\n\u003c/div\u003e\n\u003c!-- markdownlint-restore --\u003e\n\n[![Neovim][neovim-shield]][neovim-url]\n[![Lua][lua-shield]][lua-url]\n[![AGPL3 License][license-shield]][license-url]\n[![Issues][issues-shield]][issues-url]\n[![Luarocks release][ci-shield]][ci-url]\n\nPublishes packages to [LuaRocks](https://luarocks.org/) when a git tag is pushed.\nNo need to add a rockspec to your repository for each release (or at all).\n\n## Quick links\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Usage](#usage)\n- [Inputs](#inputs)\n- [Example configurations](https://github.com/nvim-neorocks/luarocks-tag-release/wiki/Example-configurations)\n- [Limitations](#limitations)\n- [Related](#related)\n- [Acknowledgements](#acknowledgements)\n\n## Features\n\n- Can generate a [rockspec](https://github.com/luarocks/luarocks/wiki/Rockspec-format)\n  based on repository metadata and information provided to the action.\n- Tests a local installation from the rockspec file before uploading.\n- Uploads the package to LuaRocks.\n- Tests the installation of the uploaded package.\n\n## Prerequisites\n\n- A LuaRocks account and an [API key](https://luarocks.org/settings/api-keys).\n- Add the API key to your [repository's GitHub Actions secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository).\n\n## Usage\n\nCreate `.github/workflows/release.yml` in your repository with the following contents:\n\n```yaml\nname: LuaRocks release\non:\n  push:\n    tags: # Will upload to luarocks.org when a tag is pushed\n      - \"*\"\n  pull_request: # Will test a local install without uploading to luarocks.org\n\njobs:\n  luarocks-release:\n    runs-on: ubuntu-latest\n    name: LuaRocks upload\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n      - name: LuaRocks Upload\n        uses: nvim-neorocks/luarocks-tag-release@v7\n        env:\n          LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e Use the `v7` tag to keep up with the latest releases, without breaking changes.\n\n## Inputs\n\nThe following optional inputs can be specified using `with:`\n\n### `name`\n\nThe name of the the luarocks package.\n\n- Defaults to the repository name.\n\n### `dependencies`\n\nLua dependencies.\nAny dependencies specified here must be available on LuaRocks.\n\nExample:\n\n```yaml\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    dependencies: |\n      plenary.nvim\n      telescope.nvim\n```\n\n### `test_dependencies`\n\nLua dependencies of the test suite.\nAny dependencies specified here must be available on LuaRocks.\n\nExample:\n\n```yaml\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    test_dependencies: |\n      luaunit\n```\n\n### `labels`\n\nLabels to add to the rockspec.\nIf none are specified, this action will use the repository's GitHub topics.\n\nExample:\n\n```yaml\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    labels: |\n      neovim\n```\n\n### `copy_directories`\n\nDirectories in the source directory to be copied to the rock installation\nprefix as-is.\nUseful for installing documentation and other files such as samples and tests.\n\nExample:\n\n```yaml\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    copy_directories: |\n      {{ neovim.plugin.dirs }}\n      src\n      examples\n```\n\n\u003e[!NOTE]\n\u003e\n\u003e The value `{{ neovim.plugin.dirs }}` (set by default)\n\u003e expands to common Neovim plugin directories (see also `:help runtimepath`):\n\u003e\n\u003e - autoload\n\u003e - colors\n\u003e - compiler\n\u003e - doc\n\u003e - filetype.lua\n\u003e - ftplugin\n\u003e - ftdetect\n\u003e - indent\n\u003e - keymap\n\u003e - lang\n\u003e - menu.vim\n\u003e - parser\n\u003e - plugin\n\u003e - queries\n\u003e - query\n\u003e - rplugin\n\u003e - spell\n\u003e - syntax\n\n\u003c!-- markdownlint-disable --\u003e\n\u003e[!WARNING]\n\u003e\n\u003e Do not use the following directory names: `lua`, `lib`, `rock_manifest`\n\u003e or the name of your rockspec; those names are used by the .rock format\n\u003e internally, and attempting to copy directories with those names using\n\u003e the build.copy_directories directive will cause a clash.\n\u003c!-- markdownlint-enable --\u003e\n\n### `summary`\n\nA short description of the package (one line).\nIf excluded, this action will fetch it from your repository's about section.\n\n### `detailed_description`\n\nA more detailed description of the package. Can be multiple lines.\n\nExample:\n\n```yaml\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    detailed_description: |\n      Publishes packages to LuaRocks when a git tag is pushed.\n      Automatically generates a rockspec from repository metadata\n      and tests the installation before releasing.\n```\n\n### `template`\n\nBy default, this workflow will generate a rockspec based on a [predefined template](resources/rockspec.template).\n\nYou can also add a modified template to your repository and specify the path\nto it with the `template` variable.\n\nExample:\n\n```yaml\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    template: \"/path/to/my/template.rockspec\"\n```\n\n### `license` (optional)\n\nThe license used by this package.\nIf not set (by default), this workflow will fetch the license SPDX ID from GitHub.\nIf GitHub cannot detect the license automatically, you can set it here.\n\nExample:\n\n```yaml\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    license: \"MIT\"\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e If GitHub can detect the license automatically,\n\u003e it will be displayed in your repository's About section.\n\u003e\n\u003e ![about](https://user-images.githubusercontent.com/12857160/218101570-b0605716-0457-47c1-ab2e-91d48a48881c.png)\n\n### `version` (optional)\n\nThe package version to release to LuaRocks (without the rockspec revision).\nBy default, this workflow will use `github.ref_name` (the git tag or branch name)\nto determine the LuaRocks package version.\nIf you do not have a workflow that releases based on tags,\nyou can manually set the version input.\n\nSetting this input to either `null`, `\"scm\"` or `\"dev\"` will result in a\nscm release, where the generated rockspec's source URL\nis the repository's URL.\n\nThe following is an example for a basic workflow that runs daily at 00:00,\nsets the package version to `0.0.\u003cnumber_of_commits\u003e`, and publishes to LuaRocks\nif there have been any commits in the last 24 hours:\n\n\u003c!-- markdownlint-disable --\u003e\n```yaml\nname: \"release\"\non:\n  workflow_dispatch: # allows manual triggering\n  schedule:\n    - cron: '0 0 * * *' # runs daily at 00:00\n  pull_request: # Will test a local install without uploading to luarocks.org\n\njobs:\n  luarocks-upload:\n    runs-on: ubuntu-22.04\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          fetch-depth: 0 # Required to count the commits\n      - name: Set luarocks version\n        run: echo \"LUAROCKS_VERSION=0.0.$(git log --oneline | wc -l)\" \u003e\u003e $GITHUB_ENV\n      - name: Get new commits\n        run: echo \"NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)\" \u003e\u003e $GITHUB_ENV\n      - name: LuaRocks Upload\n        uses: nvim-neorocks/luarocks-tag-release@v7\n        if: ${{ env.NEW_COMMIT_COUNT \u003e 0 }}\n        env:\n          LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}\n        with:\n          version: ${{ env.LUAROCKS_VERSION }}\n```\n\u003c!-- markdownlint-restore --\u003e\n\n\u003e [!NOTE]\n\u003e\n\u003e A `v` prefix (e.g. git tags such as `v1.0.0`) is also supported.\n\u003e It will be removed from the LuaRocks version.\n\n### `specrev` (optional)\n\nThe specrev (revision) of the generated rockspec. Defaults to `'1'`.\n\n\u003e [!TIP]\n\u003e\n\u003e When publishing `scm` or `dev` rockspecs, it can be useful to set\n\u003e point the source to a commit hash, and increment the `specrev` with every\n\u003e new push.\n\u003e This allows consumers to roll back or pin dev versions.\n\nExample:\n\n```yaml\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    version: \"scm\"\n    # Add logic or determining if the specrev needs to be incremented\n    specrev: \"${{ env.SPECREV }}\"\n```\n\n### `fail_on_duplicate` (optional)\n\nWhen set to `true` will cause the workflow to fail with an error if the rock already exists on the server.\nBy default, if the rock already exists with a given version, the workflow will do nothing and fall back to other tasks\ninstead (e.g. running tests).\n\n### `extra_luarocks_args`\n\nExtra args to pass to the luarocks command.\nThis is useful if luarocks cannot find headers needed for the installation.\n\nExample:\n\n```yaml\n- run: |\n    sudo apt-get install -y libcurl4-openssl-dev\n- name: LuaRocks Upload\n  uses: nvim-neorocks/luarocks-tag-release@v7\n  with:\n    extra_luarocks_args: |\n      CURL_INCDIR=/usr/include/x86_64-linux-gnu\n```\n\n\u003e [!TIP]\n\u003e\n\u003e To find out where `apt` installs headers\n\u003e (assuming you are have set `runs-on: ubuntu-xyz`),\n\u003e you can run `dpkg -L \u003cpackage-name\u003e`.\n\n## Example configurations\n\nSee the [Example configurations wiki page](https://github.com/nvim-neorocks/luarocks-tag-release/wiki/Example-configurations).\n\n## Limitations\n\n- This workflow only works on public repositories.\n- It was designed with Neovim plugins in mind. It should work with any LuaRocks package\n  (lua \u003e= 5.1), but this has not been tested.\n- This action uses lua 5.1. So any packages that depend on lua \u003e 5.1\n  will fail to install.\n\n## Related\n\n- [`rocks.nvim`](https://github.com/nvim-neorocks/rocks.nvim):\n  A modern approach to Neovim plugin management, which uses\n  luarocks.\n- [Luarocks :purple_heart: Neovim](https://github.com/nvim-neorocks/sample-luarocks-plugin):\n  A simple sample repository showing how to push your Neovim plugins to luarocks.\n\n## Acknowledgements\n\nThanks to:\n\n- [@Conni2461](https://github.com/Conni2461) for the help debugging the first drafts.\n- The [neorocks](https://github.com/nvim-neorocks) surgeons:\n  - [**@teto**](https://github.com/teto)\n  - [**@vhyrro**](https://github.com/vhyrro)\n  - [**@NTBBloodbath**](https://github.com/NTBBloodbath)\n  - [**@vigoux**](https://github.com/vigoux)\n  - [**@vsedov**](https://github.com/vsedov)\n  - [**@mrcjkb**](https://github.com/mrcjkb)\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n[neovim-shield]: https://img.shields.io/badge/NeoVim-%2357A143.svg?\u0026style=for-the-badge\u0026logo=neovim\u0026logoColor=white\n[neovim-url]: https://neovim.io/\n[lua-shield]: https://img.shields.io/badge/lua-%232C2D72.svg?style=for-the-badge\u0026logo=lua\u0026logoColor=white\n[lua-url]: https://www.lua.org/\n[issues-shield]: https://img.shields.io/github/issues/nvim-neorocks/luarocks-tag-release.svg?style=for-the-badge\n[issues-url]: https://github.com/nvim-neorocks/luarocks-tag-release/issues\n[license-shield]: https://img.shields.io/github/license/nvim-neorocks/luarocks-tag-release.svg?style=for-the-badge\n[license-url]: https://github.com/nvim-neorocks/luarocks-tag-release/blob/master/LICENSE\n[ci-shield]: https://img.shields.io/github/actions/workflow/status/nvim-neorocks/luarocks-tag-release/nix-build.yml?style=for-the-badge\n[ci-url]: https://github.com/nvim-neorocks/luarocks-tag-release/actions/workflows/nix-build.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-neorocks%2Fluarocks-tag-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-neorocks%2Fluarocks-tag-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-neorocks%2Fluarocks-tag-release/lists"}