-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (116 loc) · 4.65 KB
/
build_all.yml
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
name: Build All Platforms
on:
schedule:
- cron: '30 20 * * *' # Runs at 12:30 AM every day; adjust as necessary
workflow_dispatch:
inputs:
tag:
description: 'Blender Version Tag (e.g., v4.0.1)'
required: false
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.check.outputs.new_tag }}
new_commit: ${{ steps.check.outputs.new_commit }}
tag_input: ${{ steps.set_tag_input.outputs.tag_input }}
python_version: ${{ steps.set_python_version.outputs.python_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check latest tag and commit
id: check
if: ${{ github.event.inputs.tag == '' }}
run: python ./workspace/check_latest.py
- name: Set tag input
id: set_tag_input
run: |
if [[ "${{ github.event.inputs.tag }}" != '' ]]; then
echo "tag_input=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
echo "Building for ${{ github.event.inputs.tag }}"
elif [[ "${{ steps.check.outputs.new_tag }}" == 'true' ]]; then
echo "tag_input=${{ steps.check.outputs.latest_tag }}" >> $GITHUB_OUTPUT
echo "Building for ${{ steps.check.outputs.latest_tag }}"
# elif [[ "${{ steps.check.outputs.new_commit }}" == 'true' ]]; then
# echo "tag_input=main" >> $GITHUB_OUTPUT
# echo "Building for main"
fi
- name: Set Python version
id: set_python_version
run: |
if [[ "${{ steps.set_tag_input.outputs.tag_input }}" == v3.* ]] || [[ "${{ steps.set_tag_input.outputs.tag_input }}" == v4.0.* ]]; then
echo "python_version=3.10.11" >> $GITHUB_OUTPUT
echo "Building for Python 3.10.11"
else
echo "python_version=3.11.9" >> $GITHUB_OUTPUT
echo "Building for Python 3.11.9"
fi
# - name: Build for Windows
# if: ${{ steps.check.outputs.new_tag == 'true' || steps.check.outputs.new_commit == 'true' }}
# uses: ./.github/actions/build_windows@main
# with:
# tag: ${{ steps.check.outputs.tag_input }}
# python_version: ${{ steps.check.outputs.python_version }}
# build-stubs:
# needs: check-version
# if: ${{ needs.check-version.outputs.tag_input != '' }}
# uses: ./.github/workflows/generate_stubs.yml
# with:
# tag: ${{ needs.check-version.outputs.tag_input }}
# python_version: ${{ needs.check-version.outputs.python_version }}
# permissions:
# contents: write
build-for-windows:
needs: [check-version]
if: ${{ needs.check-version.outputs.tag_input != '' }}
uses: ./.github/workflows/build_windows.yml
with:
tag: ${{ needs.check-version.outputs.tag_input }}
python_version: ${{ needs.check-version.outputs.python_version }}
permissions:
contents: write
build-for-linux:
needs: [check-version]
if: ${{ needs.check-version.outputs.tag_input != '' }}
uses: ./.github/workflows/build_linux.yml
with:
tag: ${{ needs.check-version.outputs.tag_input }}
python_version: ${{ needs.check-version.outputs.python_version }}
permissions:
contents: write
build-for-macos:
needs: [check-version]
if: ${{ needs.check-version.outputs.tag_input != '' }}
uses: ./.github/workflows/build_macos.yml
with:
tag: ${{ needs.check-version.outputs.tag_input }}
python_version: ${{ needs.check-version.outputs.python_version }}
permissions:
contents: write
build-for-macos-intel:
needs: [check-version]
if: ${{ needs.check-version.outputs.tag_input != '' }}
uses: ./.github/workflows/build_macos_intel.yml
with:
tag: ${{ needs.check-version.outputs.tag_input }}
python_version: ${{ needs.check-version.outputs.python_version }}
permissions:
contents: write
update-versions:
runs-on: ubuntu-latest
needs: [ check-version, build-for-windows, build-for-linux, build-for-macos, build-for-macos-intel]
if: ${{ needs.check-version.outputs.new_tag == 'true' || needs.check-version.outputs.new_commit == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update versions
run: python ./workspace/check_latest.py
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email '[email protected]'
git add version_info.json
git commit -m "Update version info with latest tag and commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}