Merge pull request #33 from joshbarrass/main #179
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |