Skip to content

luzer: support metrics #281

luzer: support metrics

luzer: support metrics #281

Workflow file for this run

name: Publish
on:
push:
branches: [master]
tags: ['*']
pull_request:
jobs:
publish-scm-1:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- name: Setup luarocks
run: sudo apt install -y luarocks
- name: Setup cjson (required for upload)
run: luarocks install --local lua-cjson
- name: Upload rockspec scm-1
run: luarocks upload --force --api-key=${{ secrets.LUAROCKS_API_KEY }} luzer-scm-1.rockspec
publish-tag:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-24.04
steps:
# https://github.com/luarocks/luarocks/blob/7ed653f010671b3a7245be9adcc70068c049ef68/docs/types_of_rocks.md
- uses: actions/checkout@v3
- name: Setup luarocks
run: sudo apt install -y luarocks
# Create a rockspec for the release.
- run: printf '%s=%s\n' TAG "${GITHUB_REF##*/}" >> "${GITHUB_ENV}"
- run: sed -E
-e 's/branch = ".+"/tag = "${{ env.TAG }}"/g'
-e 's/version = ".+"/version = "${{ env.TAG }}-1"/g'
luzer-scm-1.rockspec > luzer-${{ env.TAG }}-1.rockspec
# Make a release.
- run: |
luarocks new_version --tag ${{ env.TAG }}
luarocks install luzer-${{ env.TAG }}-1.rockspec
luarocks pack luzer-${{ env.TAG }}-1.rockspec
- name: Upload .rockspec and .src.rock ${{ env.TAG }}
run: |
luarocks upload --api-key=${{ secrets.LUAROCKS_API_KEY }} luzer-${{ env.TAG }}-1.rockspec
luarocks upload --api-key=${{ secrets.LUAROCKS_API_KEY }} luzer-${{ env.TAG }}-1.src.rock
build-rock:
if: |
github.event_name == 'push' ||
github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y luarocks lua5.2 liblua5.2-dev libclang-common-14-dev clang-14
- run: sed -i -E
-e 's#branch = "master"#branch = "${{ github.head_ref || github.ref_name }}"#g'
luzer-scm-1.rockspec
- run: luarocks --local build luzer-scm-1.rockspec
- run: |
luarocks --local install luzer-scm-1.rockspec
eval $(luarocks path)
lua -l luzer
- run: luarocks --local make