-
-
Notifications
You must be signed in to change notification settings - Fork 107
153 lines (127 loc) · 4.34 KB
/
Copy pathbuild_bundle.yml
File metadata and controls
153 lines (127 loc) · 4.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# SPDX-FileCopyrightText: 2025 Howetuft, Johannes Hinrichs (CodeFHD)
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: BlendLuxCore Build Bundle
on:
pull_request:
inputs:
build_type:
required: false
type: string
default: "Latest"
workflow_call:
inputs:
build_type:
required: true
type: string
default: "Latest"
outputs:
commit:
description: "The commit that has been checked out"
value: ${{ jobs.build-bundle.outputs.commit }}
branch:
description: "The branch that has been checked out"
value: ${{ jobs.build-bundle.outputs.branch }}
attestation-url:
description: "The url to the attestations"
value: ${{ jobs.attest-bundle.outputs.attestation-url }}
workflow_dispatch:
inputs:
build_type:
required: true
type: string
default: "Release"
jobs:
build-bundle:
name: Build bundle
runs-on: ubuntu-latest
outputs:
commit: ${{ steps.current-commit.outputs.commit }}
branch: ${{ steps.current-commit.outputs.branch }}
version: ${{ steps.output-version.outputs.version }}
steps:
- name: Checkout main repository
uses: actions/checkout@v6
- name: Get current commit
id: current-commit
run: |
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "branch=$(git symbolic-ref HEAD)" >> $GITHUB_OUTPUT
echo "commit=$(git rev-parse HEAD)"
echo "branch=$(git symbolic-ref HEAD)"
#- name: Prepare Blender install
#uses: gerlero/apt-install@v1
#with:
#packages: libxxf86vm1 libxfixes3 libxi6 libxkbcommon0 libgl1
#- name: Prepare Python
#run: touch requirements.txt
#- name: Set up Python
#uses: actions/setup-python@v5
#with:
#python-version: '3.11'
#- name: Set up Blender
#uses: moguri/setup-blender@v1
#with:
#blender-version: '5.1.1'
- name: Set up cmake
uses: lukka/get-cmake@latest
- name: Download Blender
shell: bash
run: |
set -euo pipefail
BLENDER_VERSION="5.1"
BLENDER_VERSION_PATCH=".1"
BLENDER_URL="https://download.blender.org/release/Blender${BLENDER_VERSION}/blender-${BLENDER_VERSION}${BLENDER_VERSION_PATCH}-linux-x64.tar.xz"
INSTALL_DIR="$HOME/.local/opt/blender-${BLENDER_VERSION}"
BIN_DIR="$HOME/.local/bin"
mkdir -p "$INSTALL_DIR" "$BIN_DIR"
echo "Downloading Blender ${BLENDER_VERSION} LTS..."
wget -q --show-progress -O /tmp/blender.tar.xz "$BLENDER_URL"
echo "Extracting Blender to ${INSTALL_DIR}..."
tar -xf /tmp/blender.tar.xz -C "$INSTALL_DIR" --strip-components=1
rm /tmp/blender.tar.xz
echo "Creating symlink in ${BIN_DIR}..."
ln -sf "${INSTALL_DIR}/blender" "${BIN_DIR}/blender"
echo "Blender ${BLENDER_VERSION} installed successfully!"
echo "BLENDER_ROOT=${INSTALL_DIR}" >> $GITHUB_ENV
- name: Package bundle
shell: bash
run: |
apt update -y && apt install xorg -y
build_dir="${{ github.workspace }}/build"
mkdir ${build_dir}
echo "Configure"
cmake \
-B ${build_dir} \
-S . \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DBLENDER_ROOT=${BLENDER_ROOT} \
-Dblender_ROOT=${BLENDER_ROOT}
echo "Build"
cmake --build ${build_dir}
- name: Upload artifact
uses: actions/upload-artifact@v4
id: upload
with:
name: "BlendLuxCore"
path: "${{ github.workspace }}/build/out/BlendLuxCore-*.zip"
attest-wheels:
needs: [build-bundle]
runs-on: ubuntu-latest
permissions:
attestations: write
id-token: write
outputs:
attestation-url: ${{ steps.attestation-step.outputs.attestation-url }}
steps:
- uses: actions/download-artifact@v7
if: ${{ !env.ACT }}
with:
path: ${{ github.workspace }}/dist
merge-multiple: false
- name: Generate artifact attestations
id: attestation-step
if: ${{ !env.ACT }}
uses: actions/attest-build-provenance@v3
with:
subject-path: ${{ github.workspace }}/dist/*