-
-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (70 loc) · 2.13 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches: ["main"]
paths-ignore:
- "**/.md"
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: true
matrix:
platform: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: Cargo fetch
run: cargo fetch
- name: Build
run: cargo build --verbose --release
- name: Determine short GitHub SHA
shell: bash
run: |
export GITHUB_SHA_SHORT=$(git rev-parse --short "$GITHUB_SHA")
echo "GITHUB_SHA_SHORT=$GITHUB_SHA_SHORT" >> $GITHUB_ENV
- name: Cargo test
if: matrix.platform == 'ubuntu-latest'
run: cargo test --verbose --release
- name: Copy dir
run: cp -r assets ./target/release/assets
- name: Publish artifact (Windows)
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: eurochef-win-${{ env.GITHUB_SHA_SHORT }}
path: |
./target/release/*.exe
./target/release/assets
package-addon:
name: Package Blender addon
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Create temp dir
run: mkdir addon_temp
- name: Copy dir
run: cp -r blender_addon addon_temp/eurochef_utils
# - name: Zip addon
# run: zip -r eurochef_utils.zip eurochef_utils
- name: Determine short GitHub SHA
shell: bash
run: |
export GITHUB_SHA_SHORT=$(git rev-parse --short "$GITHUB_SHA")
echo "GITHUB_SHA_SHORT=$GITHUB_SHA_SHORT" >> $GITHUB_ENV
- name: Publish artifact
uses: actions/upload-artifact@v3
with:
name: blender-eurochef-utils-${{ env.GITHUB_SHA_SHORT }}
path: addon_temp/