-
Notifications
You must be signed in to change notification settings - Fork 75
138 lines (118 loc) · 4.55 KB
/
BlenderMalt.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
134
135
136
137
138
name: BLENDERMALT_PACKAGE_AND_RELEASE
on:
push:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nelonoel/[email protected]
- name: Rollback Release
uses: author/action-rollback@stable
continue-on-error: true
with:
tag: ${{ env.BRANCH_NAME }}-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.ref_type == 'branch' }}
- uses: ncipollo/release-action@v1
id: create_release
if: ${{ github.ref_type == 'branch' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ env.BRANCH_NAME }}-latest
commit: ${{ github.sha }}
prerelease: ${{ env.BRANCH_NAME != 'Release' }}
body: |
[**BlenderMalt-Windows.zip**](https://github.com/${{github.repository}}/releases/download/${{env.BRANCH_NAME}}-latest/BlenderMalt-Windows.zip)
[**BlenderMalt-Linux.zip**](https://github.com/${{github.repository}}/releases/download/${{env.BRANCH_NAME}}-latest/BlenderMalt-Linux.zip)
*(Requires Blender 3.6)*
- name: Rollback Tagged Release
uses: author/action-rollback@stable
continue-on-error: true
with:
tag: ${{ github.action_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.ref_type == 'tag' }}
- uses: ncipollo/release-action@v1
id: create_tagged_release
if: ${{ github.ref_type == 'tag' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit: ${{ github.sha }}
allowUpdates: true
prerelease: ${{ env.BRANCH_NAME != 'Release' }}
body: |
[**BlenderMalt-Windows.zip**](https://github.com/${{github.repository}}/releases/download/${{github.ref_name}}/BlenderMalt-Windows.zip)
[**BlenderMalt-Linux.zip**](https://github.com/${{github.repository}}/releases/download/${{github.ref_name}}/BlenderMalt-Linux.zip)
*(Requires Blender 3.6)*
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
tagged_upload_url: ${{ steps.create_tagged_release.outputs.upload_url }}
tagged_release_id: ${{ steps.create_tagged_release.outputs.id }}
package-blender:
needs: [release]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: setup_blender_addon.py
run: python setup_blender_addon.py --copy-modules
working-directory: ${{ github.workspace }}/scripts
- name: Zip Addon
shell: python
run: |
import shutil
shutil.make_archive('BlenderMalt', 'zip', '.', 'BlenderMalt')
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: BlenderMalt-${{ runner.os }}
path: ${{ github.workspace }}/BlenderMalt.zip
- name: Remove Old Files
uses: flcdrg/remove-release-asset-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.release.outputs.release_id }}
asset_name: BlenderMalt-${{ runner.os }}.zip
continue-on-error: true
if: ${{ github.ref_type == 'branch' }}
- name: Release Addon
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/BlenderMalt.zip
asset_name: BlenderMalt-${{ runner.os }}.zip
asset_content_type: application/zip
if: ${{ github.ref_type == 'branch' }}
- name: Remove Old Tagged Files
uses: flcdrg/remove-release-asset-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.release.outputs.tagged_release_id }}
asset_name: BlenderMalt-${{ runner.os }}.zip
continue-on-error: true
if: ${{ github.ref_type == 'tag' }}
- name: Release Tagged Addon
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.tagged_upload_url }}
asset_path: ${{ github.workspace }}/BlenderMalt.zip
asset_name: BlenderMalt-${{ runner.os }}.zip
asset_content_type: application/zip
if: ${{ github.ref_type == 'tag' }}