Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/build_launcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,81 @@ jobs:
tag_name: ${{ inputs.tag_name || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-conda:
name: Build (Conda)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.tag_name || github.ref }}
submodules: recursive

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Install uv
uses: astral-sh/setup-uv@v5

# build for linux in docker, so we can build for rocky9
# note: the current need for Conda packages is for Deadline Cloud workers,
# which are based on Rocky Linux 9.
- if: ${{ matrix.os == 'ubuntu-latest' }}
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
chmod +x ./tools/make.sh
./tools/make.sh docker-build rocky9
# set the sha256 hash for the linux package in conda_recipe.yaml
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sha256=$(sha256sum ./build_rocky9/installer/AYON-${{ inputs.tag_name }}-linux-rocky9.tar.gz | awk '{print $1}')
echo "SHA256: $sha256"
sed -i "s/sha256: .*/sha256: $sha256/" ./conda_recipe.yaml

# on windows, we need to build first the executable,
# extract it and then package it into a conda package.
- if: ${{ matrix.os == 'windows-latest' }}
run: |
powershell -File ./tools/manage.ps1 create-env
powershell -File ./tools/manage.ps1 install-runtime
powershell -File ./tools/manage.ps1 build-make-installer
./build/installer/AYON-${{ inputs.tag_name }}-win-setup.exe /VERYSILENT /DIR=C:\ayon-launcher
powershell Compress-Archive -Path C:\ayon-launcher\* -DestinationPath .\build\AYON-${{ inputs.tag_name }}-win.zip


- if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
# update the version and also the sha256 hash for the linux package in conda_recipe.yaml
run: |
sed -i "s/version: .*/version: ${{ inputs.tag_name }}/" ./conda_recipe.yaml

- if: ${{ matrix.os == 'windows-latest' }}
shell: powershell
run: |
(Get-Content ./conda_recipe.yaml) -replace 'version: .*', "version: ${{ inputs.tag_name }}" | Set-Content ./conda_recipe.yaml
- name: Build conda package
uses: prefix-dev/rattler-build-action@v0.2.39
with:
# needs to be unique for each matrix entry
artifact-name: package-${{ matrix.os }}
build-args: --target-platform ${{ matrix.os }} --recipe ./conda_recipe.yaml

- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Upload to S3
run: |
aws s3 cp output/linux-64/ayon-launcher-*.conda s3://${{ vars.S3_BUCKET_CONDA }}/Conda/Default/linux-64/
aws s3 cp output/win-64/ayon-launcher-*.conda s3://${{ vars.S3_BUCKET_CONDA }}/Conda/Default/win-64/
88 changes: 88 additions & 0 deletions conda_recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Recipe in rattler-build format.
# See https://prefix-dev.github.io/rattler-build/latest/
#
# AYON Launcher conda package
# Repackages the pre-built cx_Freeze launcher release into a conda package.

context:
version: "1.6.1"

package:
name: ayon-launcher
version: ${{ version }}

source:
- if: linux
then:
url: https://github.com/ynput/ayon-launcher/releases/download/${{ version }}/AYON-${{ version }}-linux-rocky9.tar.gz
sha256: 6883b2fac32873304d511cd4c47e35c7d982e0b3635c24e8b1a24e63845a424a
- if: win
then:
path: ./build/AYON-${{ version }}-win.zip

build:
number: 2
prefix_detection:
ignore_binary_files: true
dynamic_linking:
binary_relocation: false
missing_dso_allowlist:
- "**"
script:
- if: unix
then:
- mkdir -p $PREFIX/opt/ayon-launcher
- cp -r ayon app_launcher common dependencies lib share shim vendor version.py LICENSE $PREFIX/opt/ayon-launcher/
- mkdir -p $PREFIX/bin
- ln -sf ../opt/ayon-launcher/ayon $PREFIX/bin/ayon
- mkdir -p $PREFIX/etc/conda/activate.d
- |
cat > $PREFIX/etc/conda/activate.d/ayon-launcher.sh << 'ACTIVATE'
#!/bin/bash
export AYON_LAUNCHER_DIR="$CONDA_PREFIX/opt/ayon-launcher"
export AYON_HEADLESS_MODE=1
ACTIVATE
- chmod +x $PREFIX/etc/conda/activate.d/ayon-launcher.sh
- if: win
then:
- mkdir -p $PREFIX/opt/ayon-launcher
- cp -r ayon.exe ayon_console.exe common dependencies lib share shim vendor version.py LICENSE $PREFIX/opt/ayon-launcher/
- cp *.dll $PREFIX/opt/ayon-launcher/ || true
- mkdir -p $PREFIX/Scripts
- |
cat > $PREFIX/Scripts/ayon << 'WRAPPER'
#!/bin/bash
exec "$CONDA_PREFIX/opt/ayon-launcher/ayon_console.exe" "$@"
WRAPPER
- chmod +x $PREFIX/Scripts/ayon
- mkdir -p $PREFIX/etc/conda/activate.d
- |
cat > $PREFIX/etc/conda/activate.d/ayon-launcher.sh << 'ACTIVATE'
#!/bin/bash
export AYON_LAUNCHER_DIR="$CONDA_PREFIX/opt/ayon-launcher"
export AYON_HEADLESS_MODE=1
ACTIVATE
- chmod +x $PREFIX/etc/conda/activate.d/ayon-launcher.sh
- printf '@echo off\r\nset "AYON_LAUNCHER_DIR=%%CONDA_PREFIX%%\\opt\\ayon-launcher"\r\nset "AYON_HEADLESS_MODE=1"\r\n' > $PREFIX/etc/conda/activate.d/ayon-launcher.bat

tests:
- if: unix
then:
script:
- test -x $PREFIX/bin/ayon
- test -f $PREFIX/opt/ayon-launcher/ayon
- test -d $PREFIX/opt/ayon-launcher/dependencies
- test -d $PREFIX/opt/ayon-launcher/lib
- if: win
then:
script:
- test -x $PREFIX/Scripts/ayon
- test -f $PREFIX/opt/ayon-launcher/ayon_console.exe
- test -d $PREFIX/opt/ayon-launcher/dependencies
- test -d $PREFIX/opt/ayon-launcher/lib
- test -f $PREFIX/etc/conda/activate.d/ayon-launcher.sh

about:
summary: AYON Launcher
homepage: https://github.com/ynput/ayon-launcher
license: Apache-2.0
Loading