Skip to content

Commit

Permalink
ci: add include to release
Browse files Browse the repository at this point in the history
  • Loading branch information
Futrime committed Nov 22, 2023
1 parent ae5ac04 commit 96f2484
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release_levilamina.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,20 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: levilamina-windows-x64-${{ github.sha }}
path: bin
path: release/lib

- run: |
cp CHANGELOG.md LICENSE.md README.md bin/
python scripts/make_include.py
- run: |
cp -r include release/
- run: |
cp CHANGELOG.md LICENSE.md README.md release/
- name: Archive release
run: |
cd bin
cd release
zip -r ../levilamina-windows-x64.zip *
cd ..
Expand Down
37 changes: 37 additions & 0 deletions scripts/make_include.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os
import shutil

# Get script directory
script_dir = os.path.dirname(os.path.realpath(__file__))

# Calculate source directory
source_dir = os.path.join(script_dir, "..", "src")

# Calculate include directory
include_dir = os.path.join(script_dir, "..", "include")

# Remove include directory
if os.path.exists(include_dir):
shutil.rmtree(include_dir)

# Create include directory
os.mkdir(include_dir)

# Copy all header files recursively
for root, dirs, files in os.walk(source_dir):
for file in files:
if file.endswith(".h"):
# Calculate source file path
source_file = os.path.join(root, file)

# Calculate relative path
relative_path = os.path.relpath(source_file, source_dir)

# Calculate include file path
include_file = os.path.join(include_dir, relative_path)

# Create include directory
os.makedirs(os.path.dirname(include_file), exist_ok=True)

# Copy file
shutil.copy(source_file, include_file)

0 comments on commit 96f2484

Please sign in to comment.