This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
Last successful build before archiving #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |