-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
456 additions
and
196 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Meta Release Big 3 | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
appimage-x86_64: | ||
uses: ./.github/workflows/release-appimage-x86_64.yml | ||
mac: | ||
uses: ./.github/workflows/release-mac.yml | ||
secrets: inherit | ||
windows: | ||
uses: ./.github/workflows/release-windows.yml |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Release AppImage x86_64 | ||
|
||
on: [workflow_dispatch, workflow_call] | ||
|
||
env: | ||
SDL2_VERSION: "2.26.3" | ||
APPIMAGETOOL_VERSION: "13" | ||
GAME_SHORTNAME: "CandyCrisis" | ||
GAME_LONGNAME: "Candy Crisis" | ||
|
||
jobs: | ||
release-appimage-x86_64: | ||
runs-on: ubuntu-20.04 # Use oldest distro still supported by GitHub to cover the oldest possible glibc | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
- name: Get CPU count | ||
run: | | ||
NPROC=$(python3 -c 'import multiprocessing; print(multiprocessing.cpu_count())') | ||
echo "NPROC=$NPROC" >> $GITHUB_ENV | ||
echo CPU count = $NPROC | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
# cf. https://github.com/libsdl-org/SDL/blob/main/docs/README-linux.md | ||
- name: Get build dependencies for SDL from APT | ||
run: | | ||
sudo apt update | ||
sudo apt install -y libasound2-dev libpulse-dev \ | ||
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ | ||
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ | ||
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ | ||
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev | ||
- name: Get SDL source | ||
run: | | ||
git clone --depth 1 --branch release-${{ env.SDL2_VERSION }} https://github.com/libsdl-org/SDL | ||
- name: Configure | ||
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SDL_FROM_SOURCE=1 -DSTATIC_SDL=1 | ||
|
||
- name: Prepare artifact names | ||
run: | | ||
GAME_VERSION=$(cat build/version.txt) | ||
ARTIFACT_NAME="${{env.GAME_SHORTNAME}}-$GAME_VERSION-linux-x86_64.AppImage" | ||
echo "GAME_VERSION=$GAME_VERSION" >> $GITHUB_ENV | ||
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV | ||
- name: Build | ||
run: cmake --build build -- -j ${{ env.NPROC }} | ||
|
||
- name: Prepare AppDir | ||
run: bash packaging/prepare_appimage_appdir.sh build/${{env.GAME_SHORTNAME}} | ||
|
||
- name: Make AppImage | ||
run: | | ||
wget https://github.com/AppImage/AppImageKit/releases/download/${{env.APPIMAGETOOL_VERSION}}/appimagetool-x86_64.AppImage | ||
chmod +x appimagetool-x86_64.AppImage | ||
./appimagetool-x86_64.AppImage --no-appstream build/${{env.GAME_SHORTNAME}}.AppDir build/${{env.ARTIFACT_NAME}} | ||
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{env.ARTIFACT_NAME}} | ||
path: build/${{env.ARTIFACT_NAME}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Release Mac | ||
|
||
on: [workflow_dispatch, workflow_call] | ||
|
||
env: | ||
SDL2_VERSION: "2.26.3" | ||
GAME_SHORTNAME: "CandyCrisis" | ||
GAME_LONGNAME: "Candy Crisis" | ||
|
||
jobs: | ||
release-mac: | ||
runs-on: macos-11 | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
- name: Get CPU count | ||
run: | | ||
NPROC=$(python3 -c 'import multiprocessing; print(multiprocessing.cpu_count())') | ||
echo "NPROC=$NPROC" >> $GITHUB_ENV | ||
echo CPU count = $NPROC | ||
- name: Import codesigning certs | ||
uses: apple-actions/import-codesign-certs@v1 | ||
with: | ||
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} | ||
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Get SDL2.framework | ||
run: | | ||
curl -LO https://github.com/libsdl-org/SDL/releases/download/release-${{env.SDL2_VERSION}}/SDL2-${{env.SDL2_VERSION}}.dmg | ||
hdiutil attach SDL2-*.dmg | ||
cp -a /Volumes/SDL2/SDL2.framework SDL2.framework | ||
hdiutil detach /Volumes/SDL2 | ||
- name: Configure | ||
run: cmake -S . -B build -G Xcode -DCODE_SIGN_IDENTITY=${{ secrets.APPLE_CODE_SIGN_IDENTITY }} | ||
|
||
- name: Prepare artifact names | ||
run: | | ||
GAME_VERSION=$(cat build/version.txt) | ||
FOLDER_NAME="${{env.GAME_LONGNAME}} $GAME_VERSION" | ||
ARTIFACT_NAME="${{env.GAME_SHORTNAME}}-$GAME_VERSION-mac.dmg" | ||
echo "GAME_VERSION=$GAME_VERSION" >> $GITHUB_ENV | ||
echo "FOLDER_NAME=$FOLDER_NAME" >> $GITHUB_ENV | ||
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV | ||
- name: Build | ||
run: cmake --build build --config RelWithDebInfo -- -j ${{ env.NPROC }} | ||
|
||
#- name: Force codesigning (not necessary since we tell Xcode to do it for us) | ||
# run: codesign --force --sign ${{ secrets.APPLE_DEVELOPMENT_TEAM }} --options runtime "build/RelWithDebInfo/${{env.GAME_LONGNAME}}.app" | ||
|
||
- name: Check codesigning | ||
run: codesign -vvv --deep --strict "build/RelWithDebInfo/${{env.GAME_LONGNAME}}.app" | ||
|
||
- name: Create dmg | ||
run: | | ||
cp build/ReadMe.txt build/RelWithDebInfo | ||
hdiutil create -fs HFS+ -srcfolder build/RelWithDebInfo -volname "${{env.FOLDER_NAME}}" build/${{env.ARTIFACT_NAME}} | ||
- name: Notarize | ||
run: | | ||
xcrun notarytool store-credentials GameNotarizationProfile --apple-id ${{ secrets.APPLE_NOTARIZATION_USERNAME }} --password ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} --team-id ${{ secrets.APPLE_DEVELOPMENT_TEAM }} | ||
xcrun notarytool submit build/${{env.ARTIFACT_NAME}} --keychain-profile GameNotarizationProfile --wait | ||
- name: Staple | ||
run: xcrun stapler staple build/${{env.ARTIFACT_NAME}} | ||
|
||
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{env.ARTIFACT_NAME}} | ||
path: build/${{env.ARTIFACT_NAME}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Release Windows | ||
|
||
on: [workflow_dispatch, workflow_call] | ||
|
||
env: | ||
SDL2_VERSION: "2.26.3" | ||
GAME_SHORTNAME: "CandyCrisis" | ||
GAME_LONGNAME: "Candy Crisis" | ||
|
||
jobs: | ||
release-windows: | ||
runs-on: windows-2022 | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Get SDL | ||
run: | | ||
Invoke-WebRequest -OutFile SDL2-VC.zip -Uri https://github.com/libsdl-org/SDL/releases/download/release-${{env.SDL2_VERSION}}/SDL2-devel-${{env.SDL2_VERSION}}-VC.zip | ||
Expand-Archive SDL2-VC.zip | ||
move SDL2-VC/SDL2-* SDL2 | ||
- name: Configure | ||
run: cmake -S . -B build -G 'Visual Studio 17 2022' | ||
|
||
- name: Prepare artifact names | ||
run: | | ||
$GAME_VERSION = Get-Content build/version.txt | ||
$FOLDER_NAME = "${{env.GAME_LONGNAME}} $GAME_VERSION" | ||
$ARTIFACT_NAME = "${{env.GAME_SHORTNAME}}-$GAME_VERSION-windows-x64.zip" | ||
echo "GAME_VERSION=$GAME_VERSION" >> $env:GITHUB_ENV | ||
echo "FOLDER_NAME=$FOLDER_NAME" >> $env:GITHUB_ENV | ||
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $env:GITHUB_ENV | ||
- name: Build | ||
run: cmake --build build --config Release -- -m | ||
|
||
# Note: if the game contains C++, you should also copy msvcp140.dll and vcruntime140_1.dll | ||
- name: Copy extra stuff | ||
run: | | ||
cmake --install build --prefix build/install | ||
copy build/ReadMe.txt build/Release | ||
copy build/install/bin/vcruntime140.dll build/Release | ||
- name: Zip it up | ||
run: | | ||
move build/Release "build/${{env.FOLDER_NAME}}" | ||
Compress-Archive -Path "build/${{env.FOLDER_NAME}}" -DestinationPath build/${{env.ARTIFACT_NAME}} -CompressionLevel Optimal | ||
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{env.ARTIFACT_NAME}} | ||
path: build/${{env.ARTIFACT_NAME}} |
Oops, something went wrong.