Skip to content

Commit 6ebaf16

Browse files
authored
Merge pull request #1058 from LuxCoreRender/for_v2.11
For v2.11
2 parents 7e5ab52 + 9578619 commit 6ebaf16

3 files changed

Lines changed: 168 additions & 40 deletions

File tree

.github/workflows/build_bundle.yml

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ on:
1717
required: true
1818
type: string
1919
default: "Latest"
20+
outputs:
21+
commit:
22+
description: "The commit that has been checked out"
23+
value: ${{ jobs.build-bundle.outputs.commit }}
24+
branch:
25+
description: "The branch that has been checked out"
26+
value: ${{ jobs.build-bundle.outputs.branch }}
27+
attestation-url:
28+
description: "The url to the attestations"
29+
value: ${{ jobs.attest-bundle.outputs.attestation-url }}
2030
workflow_dispatch:
2131
inputs:
2232
build_type:
@@ -25,14 +35,26 @@ on:
2535
default: "Release"
2636

2737
jobs:
28-
build_bundle:
38+
build-bundle:
2939
name: Build bundle
3040
runs-on: ubuntu-latest
41+
outputs:
42+
commit: ${{ steps.current-commit.outputs.commit }}
43+
branch: ${{ steps.current-commit.outputs.branch }}
44+
version: ${{ steps.output-version.outputs.version }}
3145

3246
steps:
3347

3448
- name: Checkout main repository
35-
uses: actions/checkout@v4
49+
uses: actions/checkout@v6
50+
51+
- name: Get current commit
52+
id: current-commit
53+
run: |
54+
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
55+
echo "branch=$(git symbolic-ref HEAD)" >> $GITHUB_OUTPUT
56+
echo "commit=$(git rev-parse HEAD)"
57+
echo "branch=$(git symbolic-ref HEAD)"
3658
3759
- name: Prepare Blender install
3860
uses: gerlero/apt-install@v1
@@ -65,6 +87,31 @@ jobs:
6587
6688
- name: Upload artifact
6789
uses: actions/upload-artifact@v4
90+
id: upload
6891
with:
6992
name: "BlendLuxCore"
7093
path: "${{ github.workspace }}/build/out/BlendLuxCore-*.zip"
94+
95+
attest-wheels:
96+
needs: [build-bundle]
97+
runs-on: ubuntu-latest
98+
permissions:
99+
attestations: write
100+
id-token: write
101+
outputs:
102+
attestation-url: ${{ steps.attestation-step.outputs.attestation-url }}
103+
104+
steps:
105+
- uses: actions/download-artifact@v7
106+
if: ${{ !env.ACT }}
107+
with:
108+
pattern: BlendLuxCore*.zip
109+
path: ${{ github.workspace }}/dist
110+
merge-multiple: false
111+
112+
- name: Generate artifact attestations
113+
id: attestation-step
114+
if: ${{ !env.ACT }}
115+
uses: actions/attest-build-provenance@v3
116+
with:
117+
subject-path: ${{ github.workspace }}/dist/*

.github/workflows/bundle_release.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# SPDX-FileCopyrightText: 2024 Howetuft
2+
#
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
name: BlendLuxCore Create Release
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
release-version:
12+
description: "Release version (major.minor.patch[-pre])"
13+
required: True
14+
default: ''
15+
type: string
16+
allow-updates:
17+
description: "Update existing release (if any)"
18+
required: True
19+
type: boolean
20+
default: True
21+
rebuild-all:
22+
description: "Rebuild all"
23+
required: True
24+
type: boolean
25+
default: False
26+
27+
jobs:
28+
check-version:
29+
name: 'Check version compliance'
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Check version compliance
33+
if: ${{ inputs.release-version != '' }}
34+
shell: python
35+
run: |
36+
import sys
37+
import re
38+
version = "${{ inputs.release-version }}"
39+
semver_regex = r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
40+
res = re.fullmatch(semver_regex, version)
41+
if res:
42+
print("::notice::Version number OK ('{version}')")
43+
else:
44+
message = [
45+
f"::error::INVALID RELEASE VERSION NUMBER '{version}'",
46+
"Version must comply to Semantic Versioning standard:",
47+
"\n\tmajor.minor.patch[-pre]\n",
48+
"See https://semver.org for more information",
49+
"or leave the field blank for default value\n"
50+
]
51+
print("\n".join(message))
52+
sys.exit(1)
53+
54+
call-build-bundle:
55+
name: 'Build BlendLuxCore Bundle'
56+
needs: [check-version]
57+
uses: ./.github/workflows/build_bundle.yml
58+
with:
59+
build_type: Release
60+
61+
create-release:
62+
name: 'Create release'
63+
if: github.event_name == 'workflow_dispatch'
64+
runs-on: ubuntu-latest
65+
needs: [call-build-bundle]
66+
permissions:
67+
id-token: write
68+
attestations: write
69+
contents: write
70+
steps:
71+
- run: |
72+
_version=${{ inputs.release-version }}
73+
echo "Creating release '${_version}'"
74+
echo "RELEASE_TAG=v${_version}" >> "$GITHUB_ENV"
75+
- uses: actions/checkout@v6
76+
- run: mkdir ${{ github.workspace }}/dist
77+
- uses: actions/download-artifact@v7
78+
with:
79+
path: ${{ github.workspace }}/dist
80+
merge-multiple: false
81+
82+
- name: Display structure of downloaded files
83+
run: ls -Rl ${{ github.workspace }}/dist
84+
85+
#- name: Re-zip artifacts
86+
#working-directory: ${{ github.workspace }}/dist
87+
#run: |
88+
#mkdir ../artifacts
89+
#for d in */ ; do
90+
#d2=${d%/}
91+
#echo "zip ${d2}"
92+
#zip -j ../artifacts/${d2}.zip ${d2}/*
93+
#done
94+
95+
- id: make-release
96+
# Use full length commit SHA, otherwise CodeQL complains...
97+
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87
98+
with:
99+
name: "BlendLuxCore ${{ env.RELEASE_TAG }}"
100+
tag: ${{ env.RELEASE_TAG }}
101+
artifacts: ${{ github.workspace }}/dist/*
102+
removeArtifacts: true
103+
allowUpdates: ${{ inputs.allow-updates }}
104+
draft: true
105+
token: ${{ secrets.GITHUB_TOKEN }}
106+
updateOnlyUnreleased: true
107+
body: |
108+
## BlendLuxCore
109+
110+
This release was built from the following point in LuxCoreRender/BlendLuxCore:
111+
- Branch: ${{ needs.call-build-bundle.outputs.branch }}
112+
- Commit: ${{ needs.call-build-bundle.outputs.commit }}
113+
114+
Attestations:
115+
${{ needs.call-build-bundle.outputs.attestation-url }}
116+
117+
- run: |
118+
echo "### Release""" >> $GITHUB_STEP_SUMMARY
119+
echo ${{ steps.make-release.outputs.html_url }} >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)