Skip to content

Commit

Permalink
ci: added maintenance workflow to keep libraries up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgeiler committed Apr 5, 2024
1 parent d44322d commit d1c299b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Maintenance

on:
schedule:
- cron: '0 13 * * 1'

workflow_dispatch:

jobs:
update-libraries:
name: Update Libraries
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Update fenster
run: wget https://raw.githubusercontent.com/zserge/fenster/main/fenster.h -O src/fenster.h

- name: Update compat-5.3
run: |
wget https://raw.githubusercontent.com/lunarmodules/lua-compat-5.3/master/c-api/compat-5.3.h -O src/compat-5.3.h
wget https://raw.githubusercontent.com/lunarmodules/lua-compat-5.3/master/c-api/compat-5.3.c -O src/compat-5.3.c
- name: Create pull request
uses: peter-evans/[email protected]
with:
commit-message: 'chore(libs): update libraries'
signoff: true
branch: maintenance/update-libraries
delete-branch: true
title: 'chore(libs): update libraries'
body: |
This PR updates the libraries used by the project.
labels: libraries
reviewers: ${{ github.repository_owner }}
2 changes: 1 addition & 1 deletion src/lua-compat-5.3.c → src/compat-5.3.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include "lua-compat-5.3.h"
#include "compat-5.3.h"

/* don't compile it again if it already is included via compat53.h */
#ifndef COMPAT53_C_
Expand Down
6 changes: 3 additions & 3 deletions src/lua-compat-5.3.h → src/compat-5.3.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ extern "C" {
#undef COMPAT53_INCLUDE_SOURCE
#if defined(COMPAT53_PREFIX)
/* - change the symbol names of functions to avoid linker conflicts
* - lua-compat-5.3.c needs to be compiled (and linked) separately
* - compat-5.3.c needs to be compiled (and linked) separately
*/
# if !defined(COMPAT53_API)
# define COMPAT53_API extern
# endif
#else /* COMPAT53_PREFIX */
/* - make all functions static and include the source.
* - lua-compat-5.3.c doesn't need to be compiled (and linked) separately
* - compat-5.3.c doesn't need to be compiled (and linked) separately
*/
# define COMPAT53_PREFIX compat53
# undef COMPAT53_API
Expand Down Expand Up @@ -413,7 +413,7 @@ COMPAT53_API void luaL_requiref (lua_State *L, const char *modname,


#if defined(COMPAT53_INCLUDE_SOURCE)
# include "lua-compat-5.3.c"
# include "compat-5.3.c"
#endif


Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "main.h"
#include "fenster.h"
#include "lua-compat-5.3.h"
#include "compat-5.3.h"

typedef struct lua_fenster {
struct fenster *f;
Expand Down

0 comments on commit d1c299b

Please sign in to comment.