Skip to content

Build MacOS app in CI #10

Build MacOS app in CI

Build MacOS app in CI #10

Workflow file for this run

name: Wails build
on:
push:
tags:
# Match any new tag
- '*'
pull_request:
branches: [main]
workflow_dispatch: {}
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:
# - name: 'App'
# platform: 'linux/amd64'
# os: 'ubuntu-latest'
# - name: 'App'
# platform: 'windows/amd64'
# os: 'windows-latest'
- name: 'muscrat'
platform: 'darwin/arm64'
os: 'macos-14'
sign: 'false'
runs-on: ${{ matrix.build.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix-shell --run 'PATH=$(go env GOPATH)/bin:$PATH make app'
## MacOS specific steps
- name: Add macOS perms
if: runner.os == 'macOS'
run: chmod +x build/bin/*/Contents/MacOS/*
shell: bash
- name: Build .app zip file
if: runner.os == 'macOS'
shell: bash
run: |
ditto -c -k ./build/bin/muscrat.app ./build/bin/muscrat.app.zip
- name: Building Installer (unsigned)
if: runner.os == 'macOS' && ${{matrix.build.sign}} != 'true' && startsWith(github.ref, 'refs/tags/')
shell: bash
working-directory: ${{ inputs.app-working-directory }}
run: |
productbuild --component ./build/bin/muscrat.app ./build/bin/muscrat.pkg
# Upload the build artifacts
- uses: actions/upload-artifact@v3
with:
name: Wails Build ${{runner.os}} ${{matrix.build.name}}
path: |
*/bin/
*\bin\*
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
*/bin/*