feat(ci): add nicer workflows

between all those changes, now x64 builds should be produced
This commit is contained in:
javalsai 2024-08-20 23:56:54 +02:00
parent ca95d390c2
commit b900701b8f
Signed by: javalsai
SSH Key Fingerprint: SHA256:3G83yKhBUWVABVX/vPWH88xnK4+ptMtHkZGCRXD4Mk8
3 changed files with 80 additions and 12 deletions

15
.github/workflows/build-check.yml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Test Build
on:
push:
branches:
- '*'
pull_request:
branches:
- main
jobs:
check_build:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/build.yml

47
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Build Project
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch_name: x86_64
cc: gcc
cflags:
- arch_name: x64
cc: gcc
cflags: -m32
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: 1.0
- name: Build Code
run: |
make CC=${{ matrix.cc }} CFLAGS="-O3 ${{ cflags }}"
mv lidm lidm-${{ matrix.arch_name }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.arch_name }}
path: lidm-${{ matrix.arch_name }}
merge-builds:
runs-on: ubuntu-latest
needs: build
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: all-builds
pattern: build-*
delete-merged: true
retention-days: 1

View File

@ -1,4 +1,4 @@
name: C Make name: Build for Release
on: on:
release: release:
@ -10,14 +10,20 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Build Project
- name: Install deps uses: ./.github/workflows/build.yml
run: sudo apt-get install -y libpam0g-dev
- name: make - uses: actions/download-artifact@v4
run: make with:
- uses: svenstaro/upload-release-action@v2 name: all-builds
with: path: builds
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: lidm - name: Upload Builds to Release
asset_name: lidm-x86_64 # will compile for more archs other day run: |
tag: ${{ github.ref }} cd builds
for file in ./*; do
echo "Uploading $file..."
gh release upload ${{ github.event.release.tag_name }} "$file" --clobber
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}