Skip to content

Commit 6b34458

Browse files
committed
chore: add the library to the repo for Composer
Add the library to the repo and rebuild it upon a new release, so composer can copy it together with the rest of the source.
1 parent 2067682 commit 6b34458

File tree

4 files changed

+129
-1
lines changed

4 files changed

+129
-1
lines changed

.github/workflows/packagist.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,28 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10+
- uses: actions/checkout@v5
11+
12+
- uses: shivammathur/setup-php@v2
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version: "1.24"
16+
17+
- name: Build shared library
18+
run: make build
19+
20+
- run: |
21+
if ! git diff --quiet -- lib/libpubliccode-parser.so; then
22+
git config user.name "${GITHUB_ACTOR}"
23+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
24+
25+
git add lib/libpubliccode-parser.*
26+
git commit -m "ci: update lib/libpubliccode-parser.so [skip ci]"
27+
git push
28+
else
29+
echo "No changes in lib/libpubliccode-parser.so"
30+
fi
31+
1032
- name: Update Packagist
1133
run: |
1234
curl -XPOST -H'content-type:application/json' \

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/.phpunit.result.cache
55
/phpunit.xml
66
/phpstan.neon
7-
/lib/libpubliccode-parser.*
87
.DS_Store
98
.idea
109
.vscode

lib/libpubliccode-parser.h

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/* Code generated by cmd/cgo; DO NOT EDIT. */
2+
3+
/* package command-line-arguments */
4+
5+
6+
#line 1 "cgo-builtin-export-prolog"
7+
8+
#include <stddef.h>
9+
10+
#ifndef GO_CGO_EXPORT_PROLOGUE_H
11+
#define GO_CGO_EXPORT_PROLOGUE_H
12+
13+
#ifndef GO_CGO_GOSTRING_TYPEDEF
14+
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
15+
#endif
16+
17+
#endif
18+
19+
/* Start of preamble from import "C" comments. */
20+
21+
22+
#line 3 "publiccode-parser-wrapper.go"
23+
24+
#include <stdint.h>
25+
#include <stdlib.h>
26+
#include <stdbool.h>
27+
28+
struct ParserConfig {
29+
bool DisableNetwork;
30+
char *Branch;
31+
char *BaseURL;
32+
};
33+
34+
struct ParseResult {
35+
char *Data;
36+
char *Error;
37+
int ErrorCount;
38+
char **Errors;
39+
int WarningCount;
40+
char **Warnings;
41+
};
42+
43+
typedef uintptr_t ParserHandle;
44+
45+
#line 1 "cgo-generated-wrapper"
46+
47+
48+
/* End of preamble from import "C" comments. */
49+
50+
51+
/* Start of boilerplate cgo prologue. */
52+
#line 1 "cgo-gcc-export-header-prolog"
53+
54+
#ifndef GO_CGO_PROLOGUE_H
55+
#define GO_CGO_PROLOGUE_H
56+
57+
typedef signed char GoInt8;
58+
typedef unsigned char GoUint8;
59+
typedef short GoInt16;
60+
typedef unsigned short GoUint16;
61+
typedef int GoInt32;
62+
typedef unsigned int GoUint32;
63+
typedef long long GoInt64;
64+
typedef unsigned long long GoUint64;
65+
typedef GoInt64 GoInt;
66+
typedef GoUint64 GoUint;
67+
typedef size_t GoUintptr;
68+
typedef float GoFloat32;
69+
typedef double GoFloat64;
70+
#ifdef _MSC_VER
71+
#include <complex.h>
72+
typedef _Fcomplex GoComplex64;
73+
typedef _Dcomplex GoComplex128;
74+
#else
75+
typedef float _Complex GoComplex64;
76+
typedef double _Complex GoComplex128;
77+
#endif
78+
79+
/*
80+
static assertion to make sure the file is being used on architecture
81+
at least with matching size of GoInt.
82+
*/
83+
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
84+
85+
#ifndef GO_CGO_GOSTRING_TYPEDEF
86+
typedef _GoString_ GoString;
87+
#endif
88+
typedef void *GoMap;
89+
typedef void *GoChan;
90+
typedef struct { void *t; void *v; } GoInterface;
91+
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
92+
93+
#endif
94+
95+
/* End of boilerplate cgo prologue. */
96+
97+
#ifdef __cplusplus
98+
extern "C" {
99+
#endif
100+
101+
extern ParserHandle NewParser(_Bool disableNetwork, char* branch, char* baseURL);
102+
extern struct ParseResult* ParseString(ParserHandle handle, char* content);
103+
extern void FreeResult(struct ParseResult* result);
104+
105+
#ifdef __cplusplus
106+
}
107+
#endif

lib/libpubliccode-parser.so

12.3 MB
Binary file not shown.

0 commit comments

Comments
 (0)