|
| 1 | +# SPDX-FileCopyrightText: 2025 Howetuft, Johannes Hinrichs (CodeFHD) |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | + |
| 5 | +name: BlendLuxCore Blender Latest Release |
| 6 | + |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - for_v2.10 |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - for_v2.10 |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +jobs: |
| 17 | + build_bundles: |
| 18 | + name: Build bundles |
| 19 | + runs-on: ubuntu-latest |
| 20 | + |
| 21 | + steps: |
| 22 | + |
| 23 | + - name: Checkout main repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Prepare Blender install |
| 27 | + uses: gerlero/apt-install@v1 |
| 28 | + with: |
| 29 | + packages: libxxf86vm1 libxfixes3 libxi6 libxkbcommon0 libgl1 |
| 30 | + |
| 31 | + - name: Prepare Python |
| 32 | + run: touch requirements.txt |
| 33 | + |
| 34 | + - name: Set up Python |
| 35 | + uses: actions/setup-python@v5 |
| 36 | + with: |
| 37 | + python-version: '3.11' |
| 38 | + |
| 39 | + - uses: moguri/setup-blender@v1 |
| 40 | + with: |
| 41 | + blender-version: '4.2.7' |
| 42 | + |
| 43 | + - uses: lukka/get-cmake@latest |
| 44 | + |
| 45 | + - name: Package bundle |
| 46 | + shell: bash |
| 47 | + run: | |
| 48 | + build_dir="${{ github.workspace }}/build" |
| 49 | + mkdir ${build_dir} |
| 50 | + cmake -B ${build_dir} -S . -DCMAKE_BUILD_TYPE=Latest |
| 51 | + cmake --build ${build_dir} |
| 52 | + unzip -q "${build_dir}/BlendLuxCore-Latest.zip" -d "${{ github.workspace }}/unzip" |
| 53 | +
|
| 54 | + - name: Upload artifact |
| 55 | + uses: actions/upload-artifact@v4 |
| 56 | + with: |
| 57 | + name: "BlendLuxCore" |
| 58 | + path: "${{ github.workspace }}/unzip/*" |
| 59 | + |
| 60 | + #- name: Check if latest release exists |
| 61 | + # uses: f2calv/gha-check-release-exists@v2 |
| 62 | + # with: |
| 63 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + # ReleaseName: 'BlendLuxCore Latest' |
| 65 | + |
| 66 | + - name: check_release_exists |
| 67 | + shell: bash |
| 68 | + run: | |
| 69 | + echo false > ${{ github.workspace }}/tmp_release_test |
| 70 | + gh release list --json name > ${{ github.workspace }}/tmp_releases |
| 71 | + jq -r -c .[].name ${{ github.workspace }}/tmp_releases | while read i; do |
| 72 | + echo $i |
| 73 | + if [[ "$i" = "BlendLuxCore Latest" ]]; then |
| 74 | + echo true > "${{ github.workspace }}/tmp_release_test" |
| 75 | + fi |
| 76 | + done |
| 77 | + TESTRESULT=$(cat ${{ github.workspace }}/tmp_release_test) |
| 78 | + echo $TESTRESULT |
| 79 | + echo "ReleaseExists=$TESTRESULT" >> "$GITHUB_OUTPUT" |
| 80 | + env: |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + id: check_release_exists |
| 83 | + |
| 84 | + - name: test previous |
| 85 | + shell: bash |
| 86 | + run: | |
| 87 | + echo HEREITGOES |
| 88 | + echo ${{ steps.check-release-exists.outputs.ReleaseExists }} |
| 89 | + env: |
| 90 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 91 | + |
| 92 | + - name: Update latest tag |
| 93 | + uses: richardsimko/update-tag@v1 |
| 94 | + with: |
| 95 | + tag_name: latest |
| 96 | + env: |
| 97 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + |
| 99 | + #- name: Delete previous latest release |
| 100 | + # uses: liudonghua123/delete-release-action@v1 |
| 101 | + # with: |
| 102 | + # release_name: 'BlendLuxCore Latest' |
| 103 | + # if: | |
| 104 | + # ${{ steps.check-release-exists.outputs.ReleaseExists }} == 'true' |
| 105 | + # env: |
| 106 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 107 | + |
| 108 | + - name: Delete previous latest release |
| 109 | + shell: bash |
| 110 | + run: | |
| 111 | + gh release delete latest |
| 112 | + env: |
| 113 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 114 | + |
| 115 | + - name: Create new latest release |
| 116 | + uses: actions/create-release@v1 |
| 117 | + env: |
| 118 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 119 | + with: |
| 120 | + tag_name: latest |
| 121 | + release_name: 'BlendLuxCore Latest' |
| 122 | + draft: false |
| 123 | + prerelease: true |
| 124 | + |
| 125 | + - name: Release |
| 126 | + uses: softprops/action-gh-release@v2 |
| 127 | + if: github.event_name == 'release' |
| 128 | + with: |
| 129 | + files: ${{ github.workspace }}/build/BlendLuxCore-Latest.zip |
| 130 | + |
| 131 | + - name: Release binaries |
| 132 | + uses: softprops/action-gh-release@v2 |
| 133 | + with: |
| 134 | + files: ${{ github.workspace }}/build/BlendLuxCore-Latest.zip |
0 commit comments