Skip to content

huitest

huitest #280

name: Release Nightly
on: [push, workflow_dispatch]
jobs:
build:

Check failure on line 6 in .github/workflows/release_nightly.yml

View workflow run for this annotation

GitHub Actions / Release Nightly

Invalid workflow file

The workflow is not valid. .github/workflows/release_nightly.yml (Line: 6, Col: 3): The workflow must contain at least one job with no dependencies.
name: Build ${{ matrix.build_name }}
needs: create-nightly-release
if: needs.create-nightly-release.outputs.is_active == 'true'
strategy:
fail-fast: false
matrix:
include:
# Mac does two Rust builds to make a universal binary
- build_name: macos-x86_64
os: macos-14
target: x86_64-apple-darwin
MIN_MACOS_VERSION: 10.12
DESKTOP_FEATURES: sandbox,jpegxr
- build_name: macos-aarch64
os: macos-14
target: aarch64-apple-darwin
MIN_MACOS_VERSION: 11.0
DESKTOP_FEATURES: sandbox,jpegxr
env:
PACKAGE_FILE: |-
${{ needs.create-nightly-release.outputs.package_prefix }}-${{ matrix.build_name }}.${{
startsWith(matrix.name, 'macos') && 'dmg' ||
startsWith(matrix.name, 'linux') && 'tar.gz' ||
'zip'
}}
CARGO_BUILD_DIR: target/${{ matrix.target }}/release
runs-on: ${{ matrix.os }}
steps:
- name: Clone Ruffle repo
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libgtk-3-dev libudev-dev
- name: Cargo build
run: cargo build --locked --package ruffle_desktop --release ${{matrix.DESKTOP_FEATURES && '--features' }} ${{matrix.DESKTOP_FEATURES}} ${{ matrix.target && '--target' }} ${{ matrix.target }}
env:
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.MIN_MACOS_VERSION }}
- name: Package common files
run: |
mkdir package
cp README.md package/README.md
cp LICENSE.md package/LICENSE.md
- name: Package Windows files
if: runner.os == 'Windows'
run: |
cp ${{ env.CARGO_BUILD_DIR }}/ruffle_desktop.exe package/ruffle.exe
7z a ${{ env.PACKAGE_FILE }} ./package/*
- name: Package Linux files
if: runner.os == 'Linux'
run: |
cp ${{ env.CARGO_BUILD_DIR }}/ruffle_desktop package/ruffle
# We must enter the package/ directory in order to create a flat tarball (i.e. without a directory in it).
cd package
tar -czvf ../${{ env.PACKAGE_FILE }} *
- name: Build Safari Web Extension stub binary
if: runner.os == 'macOS'
run: cargo build --locked --package ruffle_web_safari --release ${{ matrix.target && '--target' }} ${{ matrix.target }}
env:
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.MIN_MACOS_VERSION }}
- name: Upload macOS build artifact
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build_name }}
path: |
${{ env.CARGO_BUILD_DIR }}/ruffle_desktop
${{ env.CARGO_BUILD_DIR }}/ruffle_web_safari
package
build-mac-universal-binary:
name: Build macOS universal binary
needs: [create-nightly-release, build, build-web]
runs-on: macos-14
env:
PACKAGE_FILE: ${{ needs.create-nightly-release.outputs.package_prefix }}-macos-universal.tar.gz
steps:
- name: Clone Ruffle repo
uses: actions/checkout@v4
- name: Download aarch64 binary
uses: actions/download-artifact@v4
with:
name: macos-aarch64
- name: Download x86_64 binary
uses: actions/download-artifact@v4
with:
name: macos-x86_64
- name: Download Safari extension
uses: actions/download-artifact@v4
with:
name: macos-safari
- name: Make universal desktop binary
run: |
lipo -create -output package/ruffle target/x86_64-apple-darwin/release/ruffle_desktop target/aarch64-apple-darwin/release/ruffle_desktop
chmod +x package/ruffle
- name: Make universal Safari stub binary
continue-on-error: true
run: |
lipo -create -output package/ruffle_web_safari target/x86_64-apple-darwin/release/ruffle_web_safari target/aarch64-apple-darwin/release/ruffle_web_safari
chmod +x package/ruffle_web_safari
- name: Create app bundle
run: |
VERSION=$(yq eval '.workspace.package.version' Cargo.toml)
sed -i "" "s/{Version}/$VERSION/" desktop/packaging/macOS/Info.plist
sed -i "" "s/{MinimumMacOSVersion}/${{ matrix.MIN_MACOS_VERSION }}/" desktop/packaging/macOS/Info.plist
sed -i "" "s/{CurrentYear}/$(date +%Y)/" desktop/packaging/macOS/Info.plist
mkdir package/Ruffle.app
mkdir package/Ruffle.app/Contents
mkdir package/Ruffle.app/Contents/MacOS
mkdir package/Ruffle.app/Contents/Resources
cp packaging/macOS/Info.plist package/Ruffle.app/Contents/Info.plist
mv package/ruffle package/Ruffle.app/Contents/MacOS/ruffle
- name: Compile asset catalog
run: |
mkdir package/Ruffle.app/Contents/Resources
xcrun actool --compile package/Ruffle.app/Contents/Resources desktop/packaging/macOS/Assets.xcassets --minimum-deployment-target ${{ matrix.MIN_MACOS_VERSION }} --platform macosx --warnings --errors --notices --include-all-app-icons
- name: Create extension bundle
continue-on-error: true
run: |
mkdir package/Ruffle.app/Contents/PlugIns
cp -r web/packages/extension/safari/package package/Ruffle.app/Contents/PlugIns/Ruffle\ Web.appex
mkdir package/Ruffle.app/Contents/PlugIns/Ruffle\ Web.appex/Contents/Resources
mkdir package/Ruffle.app/Contents/PlugIns/Ruffle\ Web.appex/Contents/MacOS
mv package/ruffle_web_safari package/Ruffle.app/Contents/PlugIns/Ruffle\ Web.appex/Contents/MacOS/ruffle_web_safari
cp ruffle_extension.zip package/Ruffle.app/Contents/PlugIns/Ruffle\ Web.appex/Contents/Resources
cd package/Ruffle.app/Contents/PlugIns/Ruffle\ Web.appex/Contents/Resources
unzip ruffle_extension.zip
rm ruffle_extension.zip
cd ../../../../../../..
- name: Sign bundle
continue-on-error: true
env:
APPLE_DEVELOPER_KEY: ${{ secrets.APPLE_DEVELOPER_KEY }}
APPLE_DEVELOPER_KEY_PASSWORD: ${{ secrets.APPLE_DEVELOPER_KEY_PASSWORD }}
run: |
echo $APPLE_DEVELOPER_KEY | base64 --decode > certificate.p12
security create-keychain -p correct-horse-battery-staple build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p correct-horse-battery-staple build.keychain
security import certificate.p12 -k build.keychain -P $APPLE_DEVELOPER_KEY_PASSWORD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k correct-horse-battery-staple build.keychain
codesign --deep -s ${{ secrets.APPLE_DEVELOPER_IDENTITY }} -f --entitlements desktop/packaging/macOS/Entitlements.plist --options runtime package/Ruffle.app
codesign --verify -vvvv package/Ruffle.app
- name: Notarize bundle
continue-on-error: true
run: |
xcrun notarytool store-credentials "Ruffle" --apple-id ${{ secrets.APPLE_ID }} --team-id ${{ secrets.APPLE_TEAM }} --password ${{ secrets.APPLE_APP_PASSWORD }}
cd package
zip -r Ruffle.zip Ruffle.app
mv Ruffle.zip ..
cd ..
xcrun notarytool submit Ruffle.zip --keychain-profile Ruffle --wait
xcrun stapler staple package/Ruffle.app
- name: Package macOS files
run: |
pip install dmgbuild
dmgbuild -s desktop/packaging/macOS/settings.py "Ruffle" "${{ env.PACKAGE_FILE }}"
- name: Upload package
run: |
gh release create "hui" --title "hoi"
gh release upload "hui" "${{ env.PACKAGE_FILE }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}