More GA fun #2
This file contains 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
on: | ||
workflow_call: | ||
inputs: | ||
steamworks_sdk_tag: | ||
required: true | ||
type: string | ||
godot_tag: | ||
required: true | ||
type: string | ||
binary_name: | ||
required: true | ||
type: string | ||
build_params: | ||
required: true | ||
type: string | ||
artifact_name: | ||
required: true | ||
type: string | ||
export_name: | ||
required: true | ||
type: string | ||
secrets: | ||
steamworks_sdk_repo: | ||
required: true | ||
steamworks_sdk_repo_token: | ||
required: true | ||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout Godot | ||
- name: Checkout Godot | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "godotengine/godot" | ||
path: "godot" | ||
ref: ${{ inputs.godot_tag }} | ||
# Checkout current source of GodotSteam Server | ||
- name: Checkout GodotSteam Server | ||
uses: actions/checkout@v4 | ||
with: | ||
path: "godotsteam_server" | ||
- name: Copy GodotSteam Server Module | ||
run: | | ||
cp -r godotsteam_server godot/modules/godotsteam_server | ||
# Checkout Steamworks SDK | ||
- name: Checkout Steamworks SDK | ||
uses: actions/checkout@v4 | ||
with: | ||
path: "steamworks" | ||
repository: ${{ secrets.steamworks_sdk_repo }} | ||
token: ${{ secrets.steamworks_sdk_repo_token }} | ||
ref: ${{ inputs.steamworks_sdk_tag }} | ||
- name: Copy Steamworks | ||
run: | | ||
cp -r steamworks/public godot/modules/godotsteam_server/sdk | ||
cp -r steamworks/redistributable_bin godot/modules/godotsteam_server/sdk | ||
- name: Install gcc-multilib | ||
if: ${{ startsWith(matrix.opts.arch, 'x86_32') && startsWith(matrix.opts.runner,'ubuntu-') }} | ||
shell: sh | ||
run: | | ||
sudo apt-get update | ||
sudo apt install gcc-multilib g++-multilib | ||
- name: Install buildroot x86_64 | ||
shell: sh | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install yasm | ||
cd /opt | ||
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 | ||
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 | ||
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 | ||
mv x86_64-godot-linux-gnu_sdk-buildroot buildroot | ||
cd buildroot | ||
./relocate-sdk.sh | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Set up SCons | ||
shell: bash | ||
run: | | ||
python -c "import sys; print(sys.version)" | ||
python -m pip install scons | ||
scons --version | ||
- name: Load .scons_cache directory | ||
id: godot-extension-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{github.workspace}}/.scons_cache/ | ||
key: ${{github.job}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}} | ||
restore-keys: | | ||
${{github.job}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}} | ||
${{github.job}}-${{env.BASE_BRANCH}}-${{github.ref}} | ||
${{github.job}}-${{env.BASE_BRANCH}}-${{env.BASE_BRANCH}} | ||
# Build the server module | ||
- name: Build Linux Binary | ||
shell: sh | ||
env: | ||
SCONS_CACHE: ${{github.workspace}}/.scons_cache/ | ||
SCONS_CACHE_LIMIT: 7168 | ||
working-directory: "godot" | ||
run: | | ||
PATH=/opt/buildroot/bin:$PATH/bin:$PATH scons ${{ inputs.build_params }} | ||
mv bin/${{ inputs.binary_name }} bin/${{ inputs.export_name }} | ||
- name: Upload Linux Build | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact_name }} | ||
path: godot/bin/${{ inputs.export_name }} | ||
overwrite: true | ||
retention-days: 1 | ||
- name: Upload Linux Steam File | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-libsteam-api-so | ||
path: godot/modules/godotsteam_server/sdk/redistributable_bin/linux64/libsteam_api.so | ||
overwrite: true | ||
retention-days: 1 |