Skip to content

Commit

Permalink
Enable GitHub Action workflow to build and deploy to LuaRocks (PR #97)
Browse files Browse the repository at this point in the history
* Delete .travis.yml
* Remove travis badge
* Create build.yml and deploy.yml
* update test.Dockerfile

---------
Signed-off-by: Manoel Campos <[email protected]>
  • Loading branch information
manoelcampos authored May 7, 2024
1 parent 7e36b2e commit 84d73a7
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 26 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: build

on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "master", "main" ]

jobs:
build:
runs-on: ubuntu-latest
env:
LUA_ROCKS_API_KEY: ${{ secrets.LUA_ROCKS_API_KEY }}

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker-compose build test
- name: Run tests
run: docker-compose run --rm test
25 changes: 25 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: deploy

# How to fire this workflow
## After you are ready to deploy your rock, you need create a git tag in the format vX.Y-Z
## git tag vX.Y-Z && git push --tags

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

jobs:
build:
uses: ./.github/workflows/build.yml
deploy:
name: Deploy rock to luarocks.org
needs: [ build ] # build must pass to deploy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Deploy to luarocks.org
run: docker-compose build upload
env:
LUA_ROCKS_API_KEY: ${{ secrets.LUA_ROCKS_API_KEY }}
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:numbered:
:unsafe:

= xml2lua image:https://travis-ci.com/manoelcampos/xml2lua.svg?branch=master[Build Status,link=https://travis-ci.com/manoelcampos/xml2lua] image:http://img.shields.io/badge/license-MIT-brightgreen.svg[MIT license,link=http://opensource.org/licenses/MIT] image:https://img.shields.io/luarocks/v/manoelcampos/xml2lua[LuaRocks,link=https://luarocks.org/modules/manoelcampos/xml2lua]
= xml2lua image:http://img.shields.io/badge/license-MIT-brightgreen.svg[MIT license,link=http://opensource.org/licenses/MIT] image:https://img.shields.io/luarocks/v/manoelcampos/xml2lua[LuaRocks,link=https://luarocks.org/modules/manoelcampos/xml2lua]

pass:[<a href="https://buymeacoff.ee/manoelcampos" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 30px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>]

Expand Down
4 changes: 2 additions & 2 deletions test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM nickblah/lua:5.4-luarocks-ubuntu
FROM nickblah/lua:5.4.6-luarocks-ubuntu

RUN apt-get update -qq > /dev/null \
&& apt-get install build-essential git zip -qq > /dev/null \
&& luarocks install dkjson --local > /dev/null \
&& luarocks install dkjson > /dev/null \
&& luarocks install luacheck > /dev/null \
&& luarocks install luacov > /dev/null \
&& luarocks install luacov-coveralls > /dev/null \
Expand Down

0 comments on commit 84d73a7

Please sign in to comment.