Sign and notarize macOS workflow artifact #142
Workflow file for this run
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: "Build FBX2glTF" | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
tags: | |
- "v*" | |
concurrency: | |
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-build | |
cancel-in-progress: true | |
jobs: | |
build-windows: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install conan | |
run: | | |
pip install --upgrade conan==1.58 | |
shell: bash | |
- name: Setup conan profile | |
run: | | |
conan profile new default --detect | |
conan profile show default | |
shell: bash | |
- name: Setup filter.lfs.required | |
run: | | |
git config --global filter.lfs.required false | |
shell: bash | |
- name: Setup filter.lfs.smudge | |
run: | | |
git config --global filter.lfs.smudge "git-lfs smudge --skip %f" | |
shell: bash | |
- name: Setup filter.lfs.process | |
run: | | |
git config --global filter.lfs.process "git-lfs filter-process --skip" | |
shell: bash | |
- name: Fetch sdk | |
run: | | |
curl -O -L "https://github.com/V-Sekai/FBXSDK-Windows/archive/refs/tags/2020.2.zip" | |
shell: cmd | |
- name: install 7z extract | |
run: | | |
7z x 2020.2.zip | |
shell: cmd | |
- name: move | |
run: | | |
mkdir -p sdk | |
mv ./FBXSDK-Windows-2020.2/sdk . | |
shell: bash | |
- name: Decompress sdk | |
run: | | |
zstd -d -r --rm ./sdk || true | |
shell: bash | |
- name: Conan install | |
run: | | |
conan install . -i build -s build_type=Release -s compiler="Visual Studio" --build missing | |
shell: cmd | |
- name: Conan build | |
run: | | |
conan build -bf build . | |
shell: cmd | |
- name: Run FBX2glTF help | |
run: | | |
./build/Release/FBX2glTF.exe --help | |
shell: bash | |
- name: Prepare artifacts | |
run: | | |
export TARGET=FBX2glTF-windows-x86_64 | |
mkdir $TARGET | |
cp sdk/Windows/2020.2/License.rtf $TARGET/FBX-SDK-License.rtf | |
cp LICENSE $TARGET/FBX2glTF-License.txt | |
cp build/Release/FBX2glTF.exe $TARGET/FBX2glTF-windows-x86_64.exe | |
7z a -r $TARGET.zip $TARGET | |
shell: bash | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
FBX2glTF-windows-x86_64.zip | |
FBX2glTF-windows-x86_64/FBX2glTF-License.txt | |
FBX2glTF-windows-x86_64/FBX-SDK-License.rtf | |
- name: FBX2glTF-windows-x86_64 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FBX2glTF-windows-x86_64 | |
path: FBX2glTF-windows-x86_64/* | |
build-linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install conan | |
run: | | |
pip install --upgrade conan==1.58 | |
shell: bash | |
- name: Setup conan profile | |
run: | | |
conan profile new default --detect | |
conan profile show default | |
shell: bash | |
- name: Setup filter.lfs.required | |
run: | | |
git config --global filter.lfs.required false | |
shell: bash | |
- name: Setup filter.lfs.smudge | |
run: | | |
git config --global filter.lfs.smudge "git-lfs smudge --skip %f" | |
shell: bash | |
- name: Setup filter.lfs.process | |
run: | | |
git config --global filter.lfs.process "git-lfs filter-process --skip" | |
shell: bash | |
- name: Fetch sdk | |
run: | | |
curl -O -L "https://github.com/V-Sekai/FBXSDK-Linux/archive/refs/tags/2020.2.zip" | |
shell: bash | |
- name: install 7z extract | |
run: | | |
7z x 2020.2.zip | |
shell: bash | |
- name: move | |
run: | | |
mkdir -p sdk | |
mv ./FBXSDK-Linux-2020.2/sdk . | |
shell: bash | |
- name: Decompress sdk | |
run: | | |
zstd -d -r --rm ./sdk || true | |
shell: bash | |
- name: Conan install | |
run: | | |
conan install . -i build -s build_type=Release --build fmt -s compiler.libcxx=libstdc++11 --build missing | |
shell: bash | |
- name: Conan build | |
run: | | |
conan build -bf build . | |
shell: bash | |
- name: Run FBX2glTF help | |
run: | | |
./build/FBX2glTF --help | |
shell: bash | |
- name: Prepare artifacts | |
run: | | |
export TARGET=FBX2glTF-linux-x86_64 | |
mkdir $TARGET | |
cp sdk/Linux/2020.2/License.txt $TARGET/FBX-SDK-License.txt | |
cp LICENSE $TARGET/FBX2glTF-License.txt | |
cp build/FBX2glTF $TARGET/FBX2glTF-linux-x86_64 | |
7z a -r $TARGET.zip $TARGET | |
shell: bash | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: FBX2glTF-linux-x86_64.zip | |
- name: FBX2glTF-linux-x86_64 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FBX2glTF-linux-x86_64 | |
path: FBX2glTF-linux-x86_64/* | |
build-macos: | |
runs-on: macos-11 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Update python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install conan | |
run: | | |
pip install --upgrade conan==1.58 | |
shell: bash | |
- name: Setup conan profile | |
run: | | |
conan profile new default --detect | |
conan profile show default | |
shell: bash | |
- name: Setup filter.lfs.required | |
run: | | |
git config --global filter.lfs.required false | |
shell: bash | |
- name: Setup filter.lfs.smudge | |
run: | | |
git config --global filter.lfs.smudge "git-lfs smudge --skip %f" | |
shell: bash | |
- name: Setup filter.lfs.process | |
run: | | |
git config --global filter.lfs.process "git-lfs filter-process --skip" | |
shell: bash | |
- name: Fetch sdk | |
run: | | |
curl -O -L "https://github.com/V-Sekai/FBXSDK-Darwin/archive/refs/tags/2020.2.zip" | |
shell: bash | |
- name: install 7z extract | |
run: | | |
7z x 2020.2.zip | |
shell: bash | |
- name: move | |
run: | | |
mkdir -p sdk | |
mv ./FBXSDK-Darwin-2020.2/sdk . | |
shell: bash | |
- name: Decompress sdk | |
run: | | |
zstd -d -r --rm ./sdk || true | |
shell: bash | |
- name: Conan install | |
run: | | |
env CMAKE_OSX_ARCHITECTURES=x86_64 conan install . -i build -s build_type=Release --settings arch=x86_64 --build missing | |
shell: bash | |
- name: Conan build | |
run: | | |
env CMAKE_OSX_ARCHITECTURES=x86_64 conan build -bf build . | |
shell: bash | |
- name: Run FBX2glTF help | |
run: | | |
./build/FBX2glTF --help | |
shell: bash | |
- name: Install the Apple certificate and provisioning profile | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
# create variables | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
# import certificate and provisioning profile from secrets | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | |
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH | |
# create temporary keychain | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
# import certificate to keychain | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
# apply provisioning profile | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | |
- name: Sign binary | |
run: | | |
codesign -s build_certificate --options=runtime build/FBX2glTF | |
shell: bash | |
- name: Prepare artifacts | |
run: | | |
export TARGET=FBX2glTF-macos-x86_64 | |
mkdir $TARGET | |
cp sdk/Darwin/2020.2/License.rtf $TARGET/FBX-SDK-License.rtf | |
cp LICENSE $TARGET/FBX2glTF-License.txt | |
cp build/FBX2glTF $TARGET/FBX2glTF-macos-x86_64 | |
7z a -r $TARGET.zip $TARGET | |
shell: bash | |
- name: Submit artifact for notarization | |
env: | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
run: | | |
xcrun notarytool submit \ | |
--apple-id $APPLE_ID \ | |
--team-id $APPLE_TEAM_ID \ | |
--password $APPLE_APP_SPECIFIC_PASSWORD \ | |
--wait \ | |
$TARGET.zip | |
shell: bash | |
- name: Staple distribution files | |
run: | | |
xcrun stapler staple $TARGET/FBX-SDK-License.rtf | |
xcrun stapler staple $TARGET/FBX2glTF-License.txt | |
xcrun stapler staple $TARGET/FBX2glTF-macos-x86_64 | |
7z a -r $TARGET.zip $TARGET | |
shell: bash | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: FBX2glTF-macos-x86_64.zip | |
- name: FBX2glTF-macos-x86_64 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FBX2glTF-macos-x86_64 | |
path: FBX2glTF-macos-x86_64/* |