Skip to content

Commit

Permalink
build: use GCC to compile & use alpine image for Docker (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
diamante0018 authored Jun 4, 2024
1 parent 27c2b2b commit 3f1d78e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 168 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ jobs:
- debug
- release
arch:
- x86
- x64
- arm64
include:
- arch: x86
platform: Win32
- arch: x64
platform: x64
- arch: arm64
Expand Down Expand Up @@ -80,6 +83,7 @@ jobs:
- debug
- release
arch:
- x86
- x64
steps:
- name: Check out files
Expand All @@ -90,19 +94,23 @@ jobs:
# NOTE - If LFS ever starts getting used during builds, switch this to true!
lfs: false

- name: Install dependencies (x64)
if: matrix.arch == 'x64'
- name: Install dependencies (x86)
if: matrix.arch == 'x86'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libcurl4-gnutls-dev -y
sudo apt-get -y install gcc-multilib g++-multilib
- name: Install Premake5
uses: diamante0018/setup-premake@master
with:
version: ${{ env.PREMAKE_VERSION }}

- name: Install Mold
uses: rui314/setup-mold@staging

- name: Generate project files
run: premake5 --cc=clang gmake2
run: premake5 gmake2

- name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master
Expand All @@ -111,9 +119,6 @@ jobs:
run: |
pushd build
make config=${{matrix.configuration}}_${{matrix.arch}} -j$(nproc)
env:
CC: clang
CXX: clang++
- name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/upload-artifact@main
Expand All @@ -124,7 +129,7 @@ jobs:
build-macos:
name: Build macOS
runs-on: macos-13
runs-on: macos-14
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -224,10 +229,10 @@ jobs:
shell: bash

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3.2.0
uses: docker/setup-buildx-action@v3.3.0

- name: Login to DockerHub
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -243,7 +248,7 @@ jobs:
- name: Build and Push Docker Image
id: build-and-push
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v5.3.0
with:
context: .
platforms: linux/amd64
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@
path = deps/libtomcrypt
url = https://github.com/libtom/libtomcrypt.git
branch = develop
[submodule "deps/curl"]
path = deps/curl
url = https://github.com/curl/curl.git
branch = curl-8_7_1
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM ubuntu:latest
FROM alpine:latest

RUN apt-get update
RUN apt-get install -y libc++-dev libcurl4-gnutls-dev
RUN apk add --no-cache gcompat libstdc++

COPY --chmod=755 ./linux-x64-release/alterware-master /usr/local/bin/

RUN groupadd alterware-master && useradd -r -g alterware-master alterware-master
RUN addgroup -S alterware-master && adduser -S alterware-master -G alterware-master
USER alterware-master

EXPOSE 20810/udp
Expand Down
1 change: 0 additions & 1 deletion deps/curl
Submodule curl deleted from de7b3e
75 changes: 0 additions & 75 deletions deps/premake/curl.lua

This file was deleted.

59 changes: 0 additions & 59 deletions src/utils/http.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions src/utils/http.hpp

This file was deleted.

0 comments on commit 3f1d78e

Please sign in to comment.