Build without nix in CI #45
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: | |
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' | |
runs-on: ${{ matrix.build.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: './go.mod' | |
# node v18.17.1 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.17.1' | |
- 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 | |
############################################################################ | |
# Code 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.SIGN_MACOS_APPLE_PASSWORD }} | |
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} | |
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64_PASSWORD }} | |
- name: Import Code-Signing Certificates for macOS Installer | |
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/') | |
uses: Apple-Actions/import-codesign-certs@v1 | |
with: | |
keychain-password: ${{ secrets.SIGN_MACOS_APPLE_PASSWORD }} | |
p12-file-base64: ${{ secrets.APPLE_INSTALLER_CERTIFICATE_P12_BASE64 }} | |
p12-password: ${{ secrets.APPLE_INSTALLER_CERTIFICATE_P12_BASE64_PASSWORD }} | |
create-keychain: false | |
- name: MacOS download gon for code signing and app notarization | |
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/') | |
run: | | |
brew install Bearer/tap/gon | |
- name: Sign our macOS binary | |
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/') | |
shell: bash | |
env: | |
APPLE_PASSWORD: ${{ secrets.SIGN_MACOS_APPLE_PASSWORD }} | |
APPLE_USERNAME: ${{ secrets.SIGN_MACOS_APPLE_USERNAME }} | |
run: | | |
echo "Signing Package" | |
envsubst < ./build/darwin/gon-sign.json.tmpl > ./build/darwin/gon-sign.json | |
gon -log-level=info ./build/darwin/gon-sign.json | |
############################################################################ | |
# Zip App | |
- name: Build .app zip file | |
if: runner.os == 'macOS' | |
shell: bash | |
run: | | |
ditto -c -k ./build/bin/muscrat.app ./build/bin/muscrat.app.zip | |
############################################################################ | |
# Build Installer | |
- name: Building Installer | |
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/') | |
shell: bash | |
run: | | |
productbuild --sign '${{ secrets.MACOS_INSTALLER_ID }}' --component ./build/bin/muscrat.app /Applications ./build/bin/muscrat.pkg | |
############################################################################ | |
# Notarize | |
- name: Notarising Installer and zip | |
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/') | |
shell: bash | |
env: | |
APPLE_PASSWORD: ${{ secrets.SIGN_MACOS_APPLE_PASSWORD }} | |
APPLE_USERNAME: ${{ secrets.SIGN_MACOS_APPLE_USERNAME }} | |
run: | | |
echo "Notarizing Package" | |
envsubst < ./build/darwin/gon-notarize.json.tmpl > ./build/darwin/gon-notarize.json | |
gon -log-level=info ./build/darwin/gon-notarize.json | |
# 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/* |