Skip to content

Build

Build #36

Workflow file for this run

name: Build
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
ZIP_NAME: blender_dds_addon
jobs:
setup:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.check-tag.outputs.tag }}
steps:
- name: Check tag
id: check-tag
run: |
if [[ ${{ github.ref }} == refs/tags/v* ]]; then
TAG=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
else
TAG=$(echo ${{ github.sha }} | cut -c1-7)
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
shell: bash
- name: Create Release Draft
id: create-release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.check-tag.outputs.tag }}
name: ${{ steps.check-tag.outputs.tag }}
body: |
Changelog
- First Change
- Second Change
draft: true
prerelease: false
build:
strategy:
matrix:
os: [windows-2022, ubuntu-20.04, macos-11]
runs-on: ${{ matrix.os }}
needs: setup
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: get sal.h (for Unix)
if: runner.os!='Windows'
run: bash external/Texconv-Custom-DLL/shell_scripts/get_sal.sh
- name: build dll (for Windows)
if: runner.os=='Windows'
run: |
external/Texconv-Custom-DLL/batch_files/build_without_vcruntime.bat
cp external/Texconv-Custom-DLL/texconv.dll addons/blender_dds_addon/directx
external/build_astcenc.bat
cp external/astc-encoder/astcenc-sse2-shared.dll addons/blender_dds_addon/astcenc
- name: build shared library (for Unix)
if: runner.os!='Windows'
run: |
bash external/Texconv-Custom-DLL/shell_scripts/build_universal.sh
cp external/Texconv-Custom-DLL/libtexconv.* addons/blender_dds_addon/directx
bash external/build_astcenc_${{ runner.os }}.sh
cp external/astc-encoder/libastcenc* addons/blender_dds_addon/astcenc
- name: Copy files
run: |
mkdir -p release
cp -r addons/${{ env.ZIP_NAME }} release
cp changelog.txt release/${{ env.ZIP_NAME }}
cp LICENSE release/${{ env.ZIP_NAME }}
shell: bash
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
directory: 'release'
type: 'zip'
filename: '${{ env.ZIP_NAME }}_${{ needs.setup.outputs.tag }}_${{ runner.os }}.zip'
exclusions: '*.git* .gitignore'
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.setup.outputs.tag }} release/${{ env.ZIP_NAME }}_${{ needs.setup.outputs.tag }}_${{ runner.os }}.zip