fallout2-ce/.github/workflows/release.yml

290 lines
7.4 KiB
YAML
Raw Normal View History

2022-07-12 11:18:19 -07:00
name: Release
on:
release:
types:
- published
defaults:
run:
shell: bash
2022-07-26 06:34:07 -07:00
jobs:
2022-07-29 10:04:37 -07:00
android:
name: Android
runs-on: ubuntu-latest
steps:
- name: Clone
2024-04-21 01:23:18 -07:00
uses: actions/checkout@v4
2022-07-29 10:04:37 -07:00
- name: Setup Java
2024-04-21 01:23:18 -07:00
uses: actions/setup-java@v3
2022-07-29 10:04:37 -07:00
with:
distribution: temurin
java-version: 11
cache: gradle
- name: Cache cmake build
2024-04-21 01:23:18 -07:00
uses: actions/cache@v4
2022-07-29 10:04:37 -07:00
with:
path: os/android/app/.cxx
key: android-cmake-v1
- name: Setup signing config
if: env.KEYSTORE_FILE_BASE64 != '' && env.KEYSTORE_PROPERTIES_FILE_BASE64 != ''
2022-07-29 10:04:37 -07:00
run: |
cd os/android
echo "$KEYSTORE_FILE_BASE64" | base64 --decode > release.keystore
echo "$KEYSTORE_PROPERTIES_FILE_BASE64" | base64 --decode > release-keystore.properties
env:
KEYSTORE_FILE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_FILE_BASE64 }}
KEYSTORE_PROPERTIES_FILE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_PROPERTIES_FILE_BASE64 }}
- name: Build
run: |
cd os/android
./gradlew assembleRelease
- name: Upload
run: |
cd os/android/app/build/outputs/apk/release
cp app-release.apk fallout2-ce-android.apk
2024-04-21 01:23:18 -07:00
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-android.apk
2022-07-29 10:04:37 -07:00
rm fallout2-ce-android.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2023-01-19 22:57:52 -08:00
ios:
name: iOS
2024-04-21 01:23:18 -07:00
runs-on: macos-12
2023-01-19 22:57:52 -08:00
steps:
- name: Clone
2024-04-21 01:23:18 -07:00
uses: actions/checkout@v4
2023-01-19 22:57:52 -08:00
- name: Cache cmake build
2024-04-21 01:23:18 -07:00
uses: actions/cache@v4
2023-01-19 22:57:52 -08:00
with:
path: build
key: ios-cmake-v1
- name: Configure
run: |
cmake \
-B build \
-D CMAKE_TOOLCHAIN_FILE=cmake/toolchain/ios.toolchain.cmake \
-D ENABLE_BITCODE=0 \
-D PLATFORM=OS64 \
2024-04-21 01:23:18 -07:00
-G Xcode \
-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY='' \
2023-01-19 22:57:52 -08:00
# EOL
- name: Build
run: |
cmake \
--build build \
2024-04-21 01:23:18 -07:00
--config RelWithDebInfo \
2023-01-19 22:57:52 -08:00
-j $(sysctl -n hw.physicalcpu) \
# EOL
2024-04-21 01:23:18 -07:00
- name: Pack
run: |
cd build
cpack -C RelWithDebInfo
2023-01-19 22:57:52 -08:00
- name: Upload
run: |
cd build
2024-04-21 01:23:18 -07:00
cp fallout2-ce.ipa fallout2-ce-ios.ipa
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-ios.ipa
2023-01-19 22:57:52 -08:00
rm fallout2-ce-ios.ipa
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-07-12 11:18:19 -07:00
linux:
name: Linux (${{ matrix.arch }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch:
- x86
- x64
steps:
- name: Clone
2024-04-21 01:23:18 -07:00
uses: actions/checkout@v4
2022-07-12 11:18:19 -07:00
- name: Dependencies (x86)
if: matrix.arch == 'x86'
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install --allow-downgrades libpcre2-8-0=10.34-7
sudo apt install g++-multilib libsdl2-dev:i386 zlib1g-dev:i386
- name: Dependencies (x64)
if: matrix.arch == 'x64'
run: |
sudo apt update
sudo apt install libsdl2-dev zlib1g-dev
- name: Cache cmake build
2024-04-21 01:23:18 -07:00
uses: actions/cache@v4
2022-07-12 11:18:19 -07:00
with:
path: build
key: linux-${{ matrix.arch }}-cmake-v1
- name: Configure (x86)
if: matrix.arch == 'x86'
run: |
cmake \
-B build \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D CMAKE_TOOLCHAIN_FILE=cmake/toolchain/Linux32.cmake \
# EOL
- name: Configure (x64)
if: matrix.arch == 'x64'
run: |
cmake \
-B build \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
# EOL
- name: Build
run: |
2022-07-26 06:49:10 -07:00
cmake \
--build build \
-j $(nproc) \
# EOL
2022-07-12 11:18:19 -07:00
- name: Upload
run: |
cd build
tar -czvf fallout2-ce-linux-${{ matrix.arch }}.tar.gz fallout2-ce
2024-04-21 01:23:18 -07:00
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-linux-${{ matrix.arch }}.tar.gz
2022-07-12 11:18:19 -07:00
rm fallout2-ce-linux-${{ matrix.arch }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
macos:
name: macOS
runs-on: macos-11
steps:
- name: Clone
2024-04-21 01:23:18 -07:00
uses: actions/checkout@v4
2022-07-12 11:18:19 -07:00
- name: Import code signing certificates
2024-04-21 01:23:18 -07:00
uses: apple-actions/import-codesign-certs@v2
2022-07-12 11:18:19 -07:00
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_FILE_BASE64 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_PASSWORD }}
- name: Cache cmake build
2024-04-21 01:23:18 -07:00
uses: actions/cache@v4
2022-07-12 11:18:19 -07:00
with:
path: build
2022-07-25 14:58:02 -07:00
key: macos-cmake-v3
2022-07-12 11:18:19 -07:00
- name: Configure
run: |
cmake \
-B build \
2024-04-21 01:23:18 -07:00
-G Xcode \
-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="${{ secrets.APPLE_DEVELOPER_CERTIFICATE_IDENTITY }}" \
-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTS="NO" \
-D CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS="--options=runtime --timestamp" \
2022-07-12 11:18:19 -07:00
# EOL
- name: Build
run: |
cmake \
--build build \
2024-04-21 01:23:18 -07:00
--config RelWithDebInfo \
2022-07-12 11:18:19 -07:00
-j $(sysctl -n hw.physicalcpu) \
# EOL
2024-04-21 01:23:18 -07:00
- name: Pack
run: |
cd build
cpack -C RelWithDebInfo
2022-07-12 11:18:19 -07:00
- name: Notarize
run: |
2024-04-21 01:23:18 -07:00
xcrun notarytool submit \
"build/Fallout II Community Edition.dmg" \
--apple-id "${{ secrets.APPLE_DEVELOPER_AC_USERNAME }}" \
--team-id "${{ secrets.APPLE_DEVELOPER_AC_TEAM }}" \
--password "${{ secrets.APPLE_DEVELOPER_AC_PASSWORD }}" \
--wait
- name: Staple
run: |
xcrun stapler staple \
"build/Fallout II Community Edition.dmg"
2022-07-12 11:18:19 -07:00
- name: Upload
run: |
cd build
2024-04-21 01:23:18 -07:00
cp "Fallout II Community Edition.dmg" fallout2-ce-macos.dmg
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-macos.dmg
2022-07-12 11:18:19 -07:00
rm fallout2-ce-macos.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows:
name: Windows (${{ matrix.arch }})
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
include:
- arch: x86
generator-platform: Win32
- arch: x64
generator-platform: x64
steps:
- name: Clone
2024-04-21 01:23:18 -07:00
uses: actions/checkout@v4
2022-07-12 11:18:19 -07:00
- name: Cache cmake build
2024-04-21 01:23:18 -07:00
uses: actions/cache@v4
2022-07-12 11:18:19 -07:00
with:
path: build
key: windows-${{ matrix.arch }}-cmake-v1
- name: Configure
run: |
cmake \
-B build \
-G "Visual Studio 16 2019" \
-A ${{ matrix.generator-platform }} \
# EOL
- name: Build
run: |
cmake \
--build build \
--config RelWithDebInfo \
# EOL
- name: Upload
run: |
cd build/RelWithDebInfo
7z a fallout2-ce-windows-${{ matrix.arch }}.zip fallout2-ce.exe
2024-04-21 01:23:18 -07:00
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-windows-${{ matrix.arch }}.zip
2022-07-12 11:18:19 -07:00
rm fallout2-ce-windows-${{ matrix.arch }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}