bug: SP-1549 Fixes building failure #51
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: Wails build | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*.*.*" | |
env: | |
# Necessary for most environments as build failure can occur due to OOM issues | |
NODE_OPTIONS: "--max-old-space-size=4096" | |
jobs: | |
build: | |
strategy: | |
# Failure in one platform build won't impact the others | |
fail-fast: false | |
matrix: | |
build: | |
- platform: "darwin/universal" | |
os: "macos-latest" | |
runs-on: ${{ matrix.build.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Setup and configure GoLang | |
- name: Setup GoLang | |
uses: actions/setup-go@v4 | |
with: | |
check-latest: true | |
go-version: "1.21" | |
- run: go version | |
shell: bash | |
# Setup and configure NodeJS | |
- name: Setup NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
# Install Wails | |
- name: Install Wails | |
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
shell: bash | |
- name: Install macOS Wails deps | |
if: runner.os == 'macOS' | |
run: brew install mitchellh/gon/gon | |
shell: bash | |
# Build | |
- name: Build App | |
if: runner.os == 'macOS' | |
run: | | |
mkdir build | |
cp -r assets build/assets | |
wails build -ldflags "-X main.version=$(git tag --sort=-version:refname | head -n 1)" --platform ${{matrix.build.platform}} --nopackage -webview2 download -o scanoss-lui-macos | |
shell: bash | |
# Set execution permissions | |
- name: Add macOS perms | |
if: runner.os == 'macOS' | |
run: chmod +x ./build/bin/scanoss-lui-macos | |
shell: bash | |
# macOS Signing | |
- name: Import Code-Signing Certificates for macOS | |
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/') | |
uses: Apple-Actions/import-codesign-certs@v1 | |
with: | |
keychain-password: ${{ secrets.APPLE_PASSWORD }} | |
p12-file-base64: ${{ secrets.MACOS_DEVELOPER_CERT }} | |
p12-password: ${{ secrets.MACOS_DEVELOPER_CERT_PASSWORD }} | |
- name: Sign macOS binary | |
if: runner.os == 'macOS' | |
env: | |
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
PROVIDER: ${{ secrets.PROVIDER }} | |
APPLICATION_IDENTITY: ${{ secrets.APPLICATION_IDENTITY }} | |
run: | | |
echo "Signing Package" | |
cd ./app-config | |
gon -log-level=debug gon-sign.json | |
cd .. | |
ls -R build/bin | |
- name: Upload macOS ZIP | |
if: runner.os == 'macOS' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: scanoss-lui-macos.zip | |
path: build/bin/scanoss-lui-macos.zip | |
# Upload build assets | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Wails Build ${{runner.os}} | |
path: | | |
*/bin/*.zip | |
*\bin\*.zip | |