This repository was archived by the owner on Feb 8, 2026. It is now read-only.
fix: improve asset download process and update dependency handling in… #20
This file contains hidden or 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
| 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: Cache Cargo registry | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image & extract artifacts (w/ cache) | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| target: artifacts | |
| outputs: type=local,dest=./release | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: List extracted DLLs | |
| run: | | |
| echo "## Build Summary" >> $GITHUB_STEP_SUMMARY | |
| for dll in release/*.dll; do | |
| [ -f "$dll" ] || continue | |
| size=$(stat -c '%s' "$dll") | |
| echo "- $(basename $dll) — $((size/1024)) KB" >> $GITHUB_STEP_SUMMARY | |
| done | |
| - 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: | | |
| timestamp=$(date +"%Y%m%d-%H%M%S") | |
| commit_short=${GITHUB_SHA::7} | |
| echo "tag=v${timestamp}-${commit_short}" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| name: Gmod Integration ${{ steps.tag.outputs.tag }} | |
| body: | | |
| Auto-build release from `${{ github.sha }}` | |
| Artifacts: | |
| ${{ steps.build.outputs.artifacts_list }} | |
| files: release/*.dll | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |