base64 (#100) #535
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 MacOS | |
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
MODE: release | |
TARGET_OS: osx | |
TARGET_ARCH: ${{ matrix.arch }} | |
TARGET_CPUREV: ${{ matrix.cpurev }} | |
JOBS: 4 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-13,macos-14] | |
arch: [x64,arm64] | |
cpurev: [legacy, default, modern] | |
steps: | |
# Checkout | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Clang Version | |
- name: Clang Version | |
run: clang --version | |
# Build | |
- name: Build | |
run: | | |
make -j${{ env.JOBS }} | |
# Binary Info (CppCore.Example.Server) | |
- name: Binary Info (CppCore.Example.Server) | |
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Example.Server | |
# Binary Info (CppCore.Example.Client) | |
- name: Binary Info (CppCore.Example.Client) | |
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Example.Client | |
# Binary Info (CppCore.Example.UI) | |
- name: Binary Info (CppCore.Example.UI) | |
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Example.UI | |
# Binary Info (CppCore.Test) | |
- name: Binary Info (CppCore.Test) | |
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Test | |
# Binary Info (CppCore.Debug) | |
- name: Binary Info (CppCore.Debug) | |
run: otool -l ./build/make/bin/osx-${{ matrix.arch }}/CppCore.Debug | |
# Binary Info (CppCore.Interface.C) | |
- name: Binary Info (CppCore.Interface.C) | |
run: otool -l ./build/make/lib/osx-${{ matrix.arch }}/libcppcore.dylib | |
# Test | |
- name: Test | |
if: | | |
(matrix.os == 'macos-12' && matrix.arch == 'x64') || | |
(matrix.os == 'macos-13' && matrix.arch == 'x64') || | |
(matrix.os == 'macos-14' && matrix.arch == 'arm64') || | |
(matrix.os == 'macos-14' && matrix.arch == 'x64' && matrix.cpurev == 'legacy') | |
run: make test | |
# Upload Binaries | |
- name: Upload Binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Binaries (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }}) | |
path: | | |
./build/make/bin/osx-${{ matrix.arch }}/* | |
!./build/make/bin/osx-${{ matrix.arch }}/.gitignore | |
# Upload Libraries | |
- name: Upload Libraries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Libraries (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }}) | |
path: | | |
./build/make/lib/osx-${{ matrix.arch }}/* | |
!./build/make/lib/osx-${{ matrix.arch }}/.gitignore | |
# Upload lto.o | |
- name: Upload lto.o | |
uses: actions/upload-artifact@v4 | |
with: | |
retention-days: 1 | |
name: lto.o (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }}) | |
path: ./build/make/obj/osx-${{ matrix.arch }}-release/**/lto.o | |
########################################################################### | |
dist: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-13] | |
cpurev: [legacy, default, modern] | |
steps: | |
# Checkout | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Download X64 Binaries | |
- name: Download X64 Binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Binaries (${{ matrix.os }}-x64-${{ matrix.cpurev }}) | |
path: ./build/make/bin/osx-x64/ | |
# Download X64 Libraries | |
- name: Download X64 Libraries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Libraries (${{ matrix.os }}-x64-${{ matrix.cpurev }}) | |
path: ./build/make/lib/osx-x64/ | |
# Download X64 lto.o | |
- name: Download X64 lto.o | |
uses: actions/download-artifact@v4 | |
with: | |
name: lto.o (${{ matrix.os }}-x64-${{ matrix.cpurev }}) | |
path: ./build/make/obj/osx-x64-release/ | |
# Download ARM64 Binaries | |
- name: Download ARM64 Binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Binaries (${{ matrix.os }}-arm64-${{ matrix.cpurev }}) | |
path: ./build/make/bin/osx-arm64/ | |
# Download ARM64 Libraries | |
- name: Download ARM64 Libraries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Libraries (${{ matrix.os }}-arm64-${{ matrix.cpurev }}) | |
path: ./build/make/lib/osx-arm64/ | |
# Download ARM64 lto.o | |
- name: Download ARM64 lto.o | |
uses: actions/download-artifact@v4 | |
with: | |
name: lto.o (${{ matrix.os }}-arm64-${{ matrix.cpurev }}) | |
path: ./build/make/obj/osx-arm64-release/ | |
# Load Code Signing Certificate | |
- name: Load Code Signing Certificate | |
env: | |
PFX_BASE64: ${{ secrets.SIGN_PFX_FILE_OSX }} | |
run: | | |
echo $PFX_BASE64 > ./certs/TrueCert.pfx.base64 | |
base64 --decode -i ./certs/TrueCert.pfx.base64 -o ./certs/TrueCert.pfx | |
# Pack | |
- name: Distribution Packages | |
env: | |
SIGN_PFX_FILE: ../../certs/TrueCert.pfx | |
SIGN_PFX_PASS: ${{ secrets.SIGN_PFX_PASS_OSX }} | |
PUBLISHERCN: "Developer ID Application: Clint Banzhaf (43RQ46H6CR)" | |
PRODUCTSIGNCN: "Developer ID Installer: Clint Banzhaf (43RQ46H6CR)" | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
APPLE_APPSPEC_PASS: ${{ secrets.APPLE_APPSPEC_PASS }} | |
APPLE_DIST_STORE: false | |
run: make dist | |
# Install Python | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
# Make (dist-python) | |
- name: Make (dist-python) | |
run: | | |
python --version | |
python -m pip install build | |
make CppCore.Interface.Python | |
# Test | |
- name: Test Python | |
if: matrix.cpurev != 'modern' | |
run: | | |
cd src/CppCore.Interface.Python | |
python -m pip install pytest crc32c pbkdf2-reboot | |
pytest | |
# Upload | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Packages (${{ matrix.os }}-${{ matrix.cpurev }}) | |
path: | | |
./dist/osx-10.15/*-universal.pkg | |
./dist/osx-10.15/*-universal.tar.gz | |
./dist/osx-10.15/*.whl | |
# Upload to Github Release | |
- name: Upload to Github Release | |
uses: softprops/action-gh-release@v1 | |
if: matrix.cpurev == 'default' && startsWith(github.ref, 'refs/tags/') | |
with: | |
token: ${{ secrets.PAT_GITHUB_ACTIONS }} | |
files: | | |
./dist/osx-10.15/*-universal.pkg | |
./dist/osx-10.15/*-universal.tar.gz | |
########################################################################### | |
dist-store: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-13] | |
steps: | |
# Checkout | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Download X64 Binaries | |
- name: Download X64 Binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Binaries (${{ matrix.os }}-x64-default) | |
path: ./build/make/bin/osx-x64/ | |
# Download X64 Libraries | |
- name: Download X64 Libraries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Libraries (${{ matrix.os }}-x64-default) | |
path: ./build/make/lib/osx-x64/ | |
# Download X64 lto.o | |
- name: Download X64 lto.o | |
uses: actions/download-artifact@v4 | |
with: | |
name: lto.o (${{ matrix.os }}-x64-default) | |
path: ./build/make/obj/osx-x64-release/ | |
# Download ARM64 Binaries | |
- name: Download ARM64 Binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Binaries (${{ matrix.os }}-arm64-default) | |
path: ./build/make/bin/osx-arm64/ | |
# Download ARM64 Libraries | |
- name: Download ARM64 Libraries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Libraries (${{ matrix.os }}-arm64-default) | |
path: ./build/make/lib/osx-arm64/ | |
# Download ARM64 lto.o | |
- name: Download ARM64 lto.o | |
uses: actions/download-artifact@v4 | |
with: | |
name: lto.o (${{ matrix.os }}-arm64-default) | |
path: ./build/make/obj/osx-arm64-release/ | |
# Load Code Signing Certificate | |
- name: Load Code Signing Certificate | |
env: | |
PFX_BASE64: ${{ secrets.SIGN_PFX_FILE_OSX }} | |
run: | | |
echo $PFX_BASE64 > ./certs/TrueCert.pfx.base64 | |
base64 --decode -i ./certs/TrueCert.pfx.base64 -o ./certs/TrueCert.pfx | |
# Pack | |
- name: Distribution Packages | |
env: | |
SIGN_PFX_FILE: ../../certs/TrueCert.pfx | |
SIGN_PFX_PASS: ${{ secrets.SIGN_PFX_PASS_OSX }} | |
PUBLISHERCN: "3rd Party Mac Developer Application: Clint Banzhaf (43RQ46H6CR)" | |
PRODUCTSIGNCN: "3rd Party Mac Developer Installer: Clint Banzhaf (43RQ46H6CR)" | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
APPLE_APPSPEC_PASS: ${{ secrets.APPLE_APPSPEC_PASS }} | |
APPLE_DIST_STORE: true | |
APPLE_UPLOAD_STORE: ${{ startsWith(github.ref, 'refs/tags/0.') || startsWith(github.ref, 'refs/tags/1.') || startsWith(github.ref, 'refs/tags/2.') }} | |
run: make dist | |
# Upload | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Packages Store (${{ matrix.os }}) | |
path: | | |
./dist/osx-10.15/*-universal.pkg | |
./dist/osx-10.15/*-universal.tar.gz |