Fix deploy flow #3413
Workflow file for this run
This file contains hidden or 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: | |
| release: | |
| types: [published] | |
| push: | |
| branches: | |
| - master | |
| - 15x | |
| - 16x | |
| - 16x_ex | |
| - 17x | |
| pull_request: | |
| branches: | |
| - master | |
| - 15x | |
| - 16x | |
| - 16x_ex | |
| - 17x | |
| env: | |
| EFFEKSEER_VERSION: 180Beta2 | |
| jobs: | |
| win_x86_build: | |
| name: Build Windows(x86) | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Setup Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.12' | |
| - uses: actions/checkout@v2 | |
| - run: | | |
| git submodule update --init | |
| git lfs install | |
| git lfs pull | |
| - uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Build | |
| run: | | |
| cmake -S . -B build -A Win32 -DBUILD_VIEWER=ON -D BUILD_TEST=ON -D BUILD_EXAMPLES=ON | |
| cmake --build ./build/ --config Release | |
| shell: cmd | |
| tests: | |
| name: Run Tests | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Setup Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.12' | |
| architecture: 'x64' | |
| - name: Pip | |
| run: | | |
| python -m pip install setuptools pillow | |
| shell: cmd | |
| - uses: actions/checkout@v2 | |
| - run: | | |
| git submodule update --init | |
| git lfs install | |
| git lfs pull | |
| - uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Build | |
| run: python build.py from_ci | |
| shell: cmd | |
| - name: Test | |
| run: | | |
| cd build/Dev/Cpp/Test/Release/ | |
| TestCpp.exe | |
| shell: cmd | |
| - name: Upload Test | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Test | |
| path: build/Dev/Cpp/Test/Release/ | |
| - name: Test | |
| run: python Script/test_screenshot.py | |
| shell: cmd | |
| Build: | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| name: [linux,windows_x64,mac] | |
| include: | |
| - name: linux | |
| os: ubuntu-22.04 | |
| label: Linux | |
| - name: windows_x64 | |
| os: windows-2022 | |
| label: Win | |
| - name: mac | |
| os: macos-14 | |
| label: Mac | |
| name: Build on ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Setup Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.12' | |
| architecture: 'x64' | |
| - name: Pip | |
| run: | | |
| python -m pip install setuptools pillow | |
| python3 -m pip install setuptools pillow | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - run: | | |
| git lfs install | |
| git lfs pull | |
| - name: Install Linux Dependencies | |
| if: matrix.name == 'linux' | |
| run: | | |
| wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg | |
| sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ | |
| wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list | |
| sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list | |
| sudo apt-get update | |
| sudo apt-get install -y libpulse-dev libglvnd-dev libx11-dev libopenal-dev libvulkan-dev \ | |
| libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libgtk-3-dev ninja-build dotnet-sdk-3.1 \ | |
| xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev zenity | |
| - uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Build | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.name }}" = "mac" ]; | |
| then | |
| export PACKAGEING_FOR_MAC=1 | |
| sudo xcode-select --switch /Applications/Xcode_15.0.1.app | |
| fi | |
| python3 build.py || python build.py | |
| - name: Validate macOS notarization secrets | |
| if: matrix.name == 'mac' | |
| shell: bash | |
| env: | |
| APPLE_CERT_P12_BASE64: ${{ secrets.APPLE_CERT_P12_BASE64 }} | |
| APPLE_CERT_P12_PASSWORD: ${{ secrets.APPLE_CERT_P12_PASSWORD }} | |
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
| APPLE_NOTARY_APPLE_ID: ${{ secrets.APPLE_NOTARY_APPLE_ID }} | |
| APPLE_NOTARY_TEAM_ID: ${{ secrets.APPLE_NOTARY_TEAM_ID }} | |
| APPLE_NOTARY_APP_PASSWORD: ${{ secrets.APPLE_NOTARY_APP_PASSWORD }} | |
| run: | | |
| for name in \ | |
| APPLE_CERT_P12_BASE64 \ | |
| APPLE_CERT_P12_PASSWORD \ | |
| APPLE_SIGNING_IDENTITY \ | |
| APPLE_NOTARY_APPLE_ID \ | |
| APPLE_NOTARY_TEAM_ID \ | |
| APPLE_NOTARY_APP_PASSWORD | |
| do | |
| if [ -z "${!name}" ]; then | |
| echo "Missing required secret: $name" >&2 | |
| exit 1 | |
| fi | |
| done | |
| - name: Setup macOS signing keychain | |
| if: matrix.name == 'mac' | |
| shell: bash | |
| env: | |
| APPLE_CERT_P12_BASE64: ${{ secrets.APPLE_CERT_P12_BASE64 }} | |
| APPLE_CERT_P12_PASSWORD: ${{ secrets.APPLE_CERT_P12_PASSWORD }} | |
| run: | | |
| CERTIFICATE_PATH="$RUNNER_TEMP/effekseer-build-certificate.p12" | |
| KEYCHAIN_PATH="$RUNNER_TEMP/effekseer-build.keychain-db" | |
| KEYCHAIN_PASSWORD="$(uuidgen)" | |
| echo "$APPLE_CERT_P12_BASE64" | base64 --decode > "$CERTIFICATE_PATH" | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security import "$CERTIFICATE_PATH" -P "$APPLE_CERT_P12_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" | |
| security list-keychains -d user -s "$KEYCHAIN_PATH" | |
| security default-keychain -d user -s "$KEYCHAIN_PATH" | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| - name: Notarize macOS tool | |
| if: matrix.name == 'mac' | |
| shell: bash | |
| env: | |
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
| APPLE_NOTARY_APPLE_ID: ${{ secrets.APPLE_NOTARY_APPLE_ID }} | |
| APPLE_NOTARY_TEAM_ID: ${{ secrets.APPLE_NOTARY_TEAM_ID }} | |
| APPLE_NOTARY_APP_PASSWORD: ${{ secrets.APPLE_NOTARY_APP_PASSWORD }} | |
| NOTARYTOOL_PROFILE: effekseer-notarytool-ci | |
| run: | | |
| SIGN_WORKDIR="$RUNNER_TEMP/notarization" | |
| rm -rf "$SIGN_WORKDIR" | |
| mkdir -p "$SIGN_WORKDIR/Effekseer" | |
| cp Script/Notarization_Mac/* "$SIGN_WORKDIR/" | |
| cp -R Dev/Mac/Effekseer.app "$SIGN_WORKDIR/Effekseer/" | |
| ( | |
| cd "$SIGN_WORKDIR" | |
| sh Effekseer_notarytool_setup.sh \ | |
| "$APPLE_NOTARY_APPLE_ID" \ | |
| "$APPLE_NOTARY_TEAM_ID" \ | |
| "$APPLE_NOTARY_APP_PASSWORD" \ | |
| "$NOTARYTOOL_PROFILE" | |
| sh Effekseer_cert.sh "$APPLE_SIGNING_IDENTITY" "$NOTARYTOOL_PROFILE" | |
| ) | |
| cp "$SIGN_WORKDIR/Effekseer.dmg" "EffekseerTool/Effekseer.dmg" | |
| - name: Upload macOS notarization logs | |
| if: failure() && matrix.name == 'mac' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: EffekseerNotarizationLogs | |
| path: | | |
| ${{ runner.temp }}/notarization/Effekseer-app-notarytool-log.json | |
| ${{ runner.temp }}/notarization/Effekseer-dmg-notarytool-log.json | |
| if-no-files-found: ignore | |
| - name: Prepare ForCpp | |
| if: matrix.name == 'windows_x64' | |
| run: | | |
| python release_cpp.py | |
| shell: cmd | |
| - name: Prepare Windows Tool | |
| run: | | |
| python release_tool.py | |
| if: matrix.name == 'windows_x64' | |
| shell: cmd | |
| - name: Prepare Linux Tool | |
| run: | | |
| python3 release_tool.py | |
| if: matrix.name == 'linux' | |
| - name: Upload ForCpp | |
| if: matrix.name == 'windows_x64' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: EffekseerForCpp${{ env.EFFEKSEER_VERSION }} | |
| path: EffekseerForCpp | |
| - name: Upload ${{matrix.name}} Tool | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Effekseer${{ env.EFFEKSEER_VERSION }}${{matrix.label}} | |
| path: EffekseerTool | |
| Deploy: | |
| needs: [tests,Build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Effekseer${{ env.EFFEKSEER_VERSION }}Win | |
| path: dist/Effekseer${{ env.EFFEKSEER_VERSION }}Win | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Effekseer${{ env.EFFEKSEER_VERSION }}Linux | |
| path: dist/Effekseer${{ env.EFFEKSEER_VERSION }}Linux | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: EffekseerForCpp${{ env.EFFEKSEER_VERSION }} | |
| path: dist/EffekseerForCpp${{ env.EFFEKSEER_VERSION }} | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Effekseer${{ env.EFFEKSEER_VERSION }}Mac | |
| path: dist/Effekseer${{ env.EFFEKSEER_VERSION }}Mac | |
| - name: Prepare Release | |
| run: | | |
| mkdir -p pub | |
| cd dist | |
| for asset in \ | |
| "Effekseer${{ env.EFFEKSEER_VERSION }}Win" \ | |
| "Effekseer${{ env.EFFEKSEER_VERSION }}Linux" \ | |
| "Effekseer${{ env.EFFEKSEER_VERSION }}Mac" \ | |
| "EffekseerForCpp${{ env.EFFEKSEER_VERSION }}" | |
| do | |
| zip -r "../pub/$asset.zip" "$asset" | |
| done | |
| - name: Upload Release artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: EffekseerReleaseAll | |
| path: pub | |
| - name: Deploy to Github Releases | |
| if: github.event_name == 'release' | |
| run: | | |
| releaseId=$(jq --raw-output '.release.id' ${GITHUB_EVENT_PATH}) | |
| echo "Upload to release $releaseId" | |
| for filename in \ | |
| "Effekseer${{ env.EFFEKSEER_VERSION }}Win.zip" \ | |
| "Effekseer${{ env.EFFEKSEER_VERSION }}Linux.zip" \ | |
| "Effekseer${{ env.EFFEKSEER_VERSION }}Mac.zip" \ | |
| "EffekseerForCpp${{ env.EFFEKSEER_VERSION }}.zip" | |
| do | |
| url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/$releaseId/assets?name=$(basename $filename)" | |
| echo "Upload $filename to $url" | |
| curl -L \ | |
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Content-Type: application/binary" \ | |
| --data-binary @"pub/$filename" \ | |
| "$url" | |
| done | |