Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

feat: add configuration loading and branch handling for integration u… #10

feat: add configuration loading and branch handling for integration u…

feat: add configuration loading and branch handling for integration u… #10

name: Build and Release DLLs
on:
push:
branches: [main, master]
paths:
- 'crates/**'
- 'Cargo.*'
- 'rust-toolchain.toml'
- 'Dockerfile'
pull_request:
branches: [main, master]
paths:
- 'crates/**'
- 'Cargo.*'
- 'rust-toolchain.toml'
- 'Dockerfile'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image with artifacts
run: |
docker build --target artifacts -t build-artifacts .
- name: Extract DLL files from Docker image
run: |
# Create output directory
mkdir -p release
# Create a temporary container and copy files
container_id=$(docker create build-artifacts)
docker cp $container_id:/out/. ./release/
docker rm $container_id
# List extracted files
echo "Extracted files:"
ls -la release/
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: gmod-integration-dlls
path: release/
retention-days: 30
- name: Generate release tag
id: tag
run: |
# Generate timestamp-based tag
timestamp=$(date +"%Y%m%d-%H%M%S")
commit_short=$(echo ${{ github.sha }} | cut -c1-7)
tag="v${timestamp}-${commit_short}"
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "Generated tag: ${tag}"
- name: Create Release
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: 'Gmod Integration ${{ steps.tag.outputs.tag }}'
body: |
## Auto-generated release
**Commit:** ${{ github.sha }}
**Branch:** ${{ github.ref_name }}
**Timestamp:** ${{ steps.tag.outputs.tag }}
### Included DLLs:
- `gmsv_gmod_integration_linux.dll` - Linux 32-bit
- `gmsv_gmod_integration_linux64.dll` - Linux 64-bit
- `gmsv_gmod_integration_win32.dll` - Windows 32-bit
- `gmsv_gmod_integration_win64.dll` - Windows 64-bit
- `gmsv_gmod_integration_loader_linux.dll` - Linux 32-bit Loader
- `gmsv_gmod_integration_loader_linux64.dll` - Linux 64-bit Loader
- `gmsv_gmod_integration_loader_win32.dll` - Windows 32-bit Loader
- `gmsv_gmod_integration_loader_win64.dll` - Windows 64-bit Loader
### Installation:
Download the appropriate DLL files for your platform and place them in `garrysmod/lua/bin/`
files: release/*.dll
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Summary
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "✅ Successfully built all DLL files" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Generated Files:" >> $GITHUB_STEP_SUMMARY
for dll in release/*.dll; do
if [ -f "$dll" ]; then
filename=$(basename "$dll")
size=$(ls -lh "$dll" | awk '{print $5}')
echo "- \`$filename\` ($size)" >> $GITHUB_STEP_SUMMARY
fi
done
if [ "${{ github.event_name }}" == "push" ] && ([ "${{ github.ref }}" == "refs/heads/main" ] || [ "${{ github.ref }}" == "refs/heads/master" ]); then
echo "" >> $GITHUB_STEP_SUMMARY
echo "🚀 **Release created:** ${{ steps.tag.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
fi