ci: add macOS + Windows + Linux build #20
Workflow file for this run
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
name: Build Launcher | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
build: [windows, linux] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chickensoft-games/setup-godot@v1 | ||
with: | ||
version: 4.2.1 | ||
use-dotnet: false | ||
- name: Verify Setup | ||
run: | | ||
godot --version | ||
- name: Export build | ||
run: | | ||
Check failure on line 28 in .github/workflows/build.yml GitHub Actions / Build LauncherInvalid workflow file
|
||
godot --headless --export-debug "${{ matrix.build === 'windows' ? 'Windows Desktop' : 'Linux/X11' }}" --verbose 2>&1 | ||
# for some reason godot doesn't exit with non-zero code on failure... | ||
# however, we'll fail on the build upload step if we errored! | ||
echo status $? | ||
- name: Upload build | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: drivechain_launcher_${{ matrix.build }} | ||
if-no-files-found: error | ||
path: build/drivechain_launcher-* | ||
macos: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chickensoft-games/setup-godot@v1 | ||
with: | ||
version: 4.2.1 | ||
use-dotnet: false | ||
- name: Verify Setup | ||
run: | | ||
godot --version | ||
- name: Import certificate to Keychain | ||
run: | | ||
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12 | ||
KEYCHAIN_PASSWORD=$(uuidgen) | ||
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | ||
security default-keychain -s build.keychain | ||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | ||
security import ./certificate.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign | ||
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" ~/Library/Keychains/build.keychain | ||
env: | ||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} | ||
- name: Setup notarization credentials | ||
run: | | ||
echo ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }} | base64 --decode > notarization_api_key.p8 | ||
- name: Export build | ||
run: | | ||
# tee the output: it's nice to browse from the CI web UI, but we | ||
# also need to find the notarization request UUID | ||
godot --headless --export-debug macOS --verbose 2>&1 | tee build.log | ||
# for some reason godot doesn't exit with non-zero code on failure... | ||
# however, we'll fail on the build upload step if we errored! | ||
echo status $? | ||
env: | ||
GODOT_MACOS_NOTARIZATION_API_KEY_ID: | ||
${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} | ||
GODOT_MACOS_NOTARIZATION_API_KEY: ./notarization_api_key.p8 | ||
GODOT_MACOS_NOTARIZATION_API_UUID: | ||
${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }} | ||
- name: Upload build | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: drivechain_launcher_macos | ||
if-no-files-found: error | ||
path: build/drivechain_launcher-* | ||
- name: Wait for notarization to finish | ||
run: | | ||
request_id=$(grep 'Notarization request UUID' build.log | rev | cut -d ' ' -f 1 | rev | tr -d '"') | ||
xcrun notarytool wait $request_id \ | ||
--issuer ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }} \ | ||
--key-id ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} \ | ||
--key ./notarization_api_key.p8 |