This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (76 loc) · 2.67 KB
/
luabitop_compilation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This file is part of LuaBitOp-DLL.
#
# Copyright (C) 2023 Airbus CyberSecurity SAS
#
# LuaBitOp-DLL is free software, released under the MIT license.
name: Compilation
'on':
- push
env:
LUABITOP_VERSION: "1.0.2"
WIRESHARK_VERSION: "4.2.3"
LUA_VERSION: "5.2.4"
jobs:
Build_Windows:
runs-on: windows-latest
permissions:
contents: write
steps:
## Get all source archives
- name: Get License
uses: actions/checkout@v4
with:
sparse-checkout: .
- name: Get LuaBitOp
run: Invoke-WebRequest -Uri http://bitop.luajit.org/download/LuaBitOp-${env:LUABITOP_VERSION}.zip -OutFile dll.zip
- name: Get Wireshark
run: Invoke-WebRequest -Uri https://2.na.dl.wireshark.org/win64/Wireshark-${env:WIRESHARK_VERSION}-x64.exe -OutFile wireshark.exe
- name: Get Lua
run: Invoke-WebRequest -Uri https://www.lua.org/ftp/lua-${env:LUA_VERSION}.tar.gz -OutFile lua.tar.gz
## Extract / rename folders and delete downloads
- name: Unzip DLL source code
run: tar -xf dll.zip
- name: Normalize DLL source code folder
run: mv LuaBitOp* dll
- name: Delete DLL source code archive
run: rm dll.zip
- name: Unzip Lua source code
run: tar -xf lua.tar.gz
- name: Normalize Lua source code folder
run: mv lua-* lua
- name: Delete Lua source code archive
run: rm lua.tar.gz
- name: Extract lua52.dll from wireshark.exe
run: 7z e wireshark.exe lua52.dll
- name: Rename Lua DLL with the right name for the build
run: mv lua52.dll lua51.dll
- name: Delete Wireshark executable
run: rm wireshark.exe
## Copy everything in build directory (dll) and compile
- name: Copy Lua Source code to build directory
run: cp lua\src\* dll
- name: Compile
run: cd dll && mingw32-make -f Makefile.mingw
- name: Copy Lua Source code to build directory
run: cp dll/bit.dll bit.dll
## Archive dll for download
- name: Archive DLL as artifact
uses: actions/upload-artifact@v4
with:
name: LuaBitOp-DLL
path: |
bit.dll
LICENSE
README.md
if-no-files-found: error
## Release on tag
- name: Download artifact
uses: actions/download-artifact@v4
- name: Zip release
run: Compress-Archive -Path LuaBitOp-DLL\* -CompressionLevel Optimal -DestinationPath LuaBitOp-DLL.zip
- name: Release DLL
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: LuaBitOp-DLL.zip
fail_on_unmatched_files: true