build: follow naming conventing about binary postfix used by Xash3D (#671)

ci: add builds for apple silicon
This commit is contained in:
jeefo 2025-02-15 15:55:16 +03:00 committed by GitHub
commit abbc5bfc5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 57 additions and 8 deletions

View file

@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
arch: ['linux-x86', 'linux-amd64', 'linux-x86-gcc', 'linux-aarch64', 'darwin-x86', 'windows-x86-clang', 'windows-amd64', 'windows-x86-gcc']
arch: ['linux-x86', 'linux-amd64', 'linux-x86-gcc', 'linux-arm64', 'darwin-x86', 'windows-x86-clang', 'windows-amd64', 'windows-x86-gcc']
fail-fast: false
steps:
@ -49,7 +49,7 @@ jobs:
shell: bash
run: |
meson compile -C ${{matrix.arch}}
echo "artifcat=${{matrix.arch}}/`ls ${{matrix.arch}}/ | egrep '^yapb.(so|dylib|dll)$' | head -1`" >> $GITHUB_ENV
echo "artifcat=${{matrix.arch}}/`ls ${{matrix.arch}}/ | egrep '^yapb*.*(so|dylib|dll)$' | head -1`" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
@ -98,14 +98,46 @@ jobs:
name: ${{matrix.arch}}
path: |
${{matrix.arch}}/yapb.dll
${{matrix.arch}}/yapb.pdb
bot-apple:
env:
name: darwin-arm64
strategy:
matrix:
arch: ['darwin-arm64']
fail-fast: false
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Install meson
run: |
python -m pip install --upgrade meson ninja
- name: Configure meson
run: |
meson setup ${{matrix.arch}}
- name: Build sources
run: |
meson compile -C ${{matrix.arch}}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{matrix.arch}}
path: |
${{matrix.arch}}/yapb*.dylib
bot-continuous-release:
if: github.event_name == 'push'
name: bot-continuous-release
runs-on: ubuntu-latest
needs: [bot-build, bot-msvc]
needs: [bot-build, bot-msvc, bot-apple]
steps:
- name: Checkout repository

View file

@ -303,9 +303,18 @@ if os == 'windows' and git.found()
)
endif
target_name = meson.project_name()
# xash specific postfix for binaries
if cpu == 'aarch64'
target_name += '_arm64'
elif opt_64bit
target_name += '_amd64'
endif
# instruct meson we're want our little shared lib bot
shared_library(
meson.project_name(),
target_name,
sources,
include_directories: includes,
gnu_symbol_visibility: 'hidden',

View file

@ -81,7 +81,7 @@ class BotSign(object):
return False
class BotPackage(object):
def __init__(self, name: str, archive: str, artifact: dict, extra: bool = False):
def __init__(self, name: str, archive: str, artifact: dict, extra: bool = False):
self.name = name
self.archive = archive
self.artifact = artifact
@ -133,7 +133,7 @@ class BotRelease(object):
self.pkg_matrix.append (BotPackage('windows', 'exe', {'windows-x86': 'dll'}))
self.pkg_matrix.append (BotPackage('linux', 'tar.xz', {'linux-x86': 'so'}))
self.pkg_matrix.append (BotPackage('extras', 'zip',
{'linux-aarch64': 'so',
{'linux-arm64': 'so',
'linux-amd64': 'so',
'linux-x86-gcc': 'so',
'windows-x86-gcc': 'dll',
@ -141,6 +141,7 @@ class BotRelease(object):
'windows-x86-msvc-xp': 'dll',
'windows-amd64': 'dll',
'darwin-x86': 'dylib',
'darwin-arm64': 'dylib',
}, extra=True))
def create_dirs(self):
@ -255,7 +256,14 @@ class BotRelease(object):
num_artifacts = len(pkg.artifact)
for artifact in pkg.artifact:
binary = os.path.join(self.artifacts, artifact, f'{self.project}.{pkg.artifact[artifact]}')
binary_name = self.project
if artifact.endswith('arm64'):
binary_name = binary_name + '_arm64'
elif artifact.endswith('amd64'):
binary_name = binary_name + '_amd64'
binary = os.path.join(self.artifacts, artifact, f'{binary_name}.{pkg.artifact[artifact]}')
binary_base = os.path.basename(binary)
if not os.path.exists(binary):