Runik build #26
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: Runik build | |
on: | |
push: | |
tags: | |
# Match any new tag | |
- '*' | |
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: 'runik' | |
platform: 'linux/amd64' | |
os: 'ubuntu-latest' | |
- name: 'runik' | |
platform: 'windows/amd64' | |
os: 'windows-latest' | |
- name: 'runik' | |
platform: 'darwin/universal' | |
os: 'macos-latest' | |
runs-on: ${{ matrix.build.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# setup go | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
# setup node | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
# install and setup wails | |
- name: Install Wails | |
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
shell: bash | |
# OS specific setup | |
- name: Install Linux deps | |
if: runner.os == 'Linux' | |
# Install flatpak and add flathub remote for linux bundling | |
run: | | |
sudo apt-get update && sudo apt-get install flatpak -y | |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
shell: bash | |
- name: Install macOS deps | |
if: runner.os == 'macOS' | |
# Wails deps for macos | |
run: brew install mitchellh/gon/gon | |
shell: bash | |
- name: Install Windows deps | |
if: runner.os == 'Windows' | |
# install gcc so windows can compile dictutil | |
run: choco install mingw | |
shell: pwsh | |
# Build runik | |
- name: Build Runik for Linux | |
if: runner.os == 'Linux' | |
run: | | |
flatpak-builder --force-clean --user --install-deps-from=flathub --repo=build/bin/repo build/bin/build-dir build/linux/app.runik.runik.yml && \ | |
flatpak build-bundle build/bin/repo build/bin/runik.flatpak app.runik.runik && \ | |
rm -r build/bin/repo && \ | |
rm -r build/bin/build-dir && \ | |
rm -r .flatpak-builder | |
- name: Build Runik for macOS | |
if: runner.os == 'macOS' | |
run: wails build --platform ${{ matrix.build.platform }} -o ${{ matrix.build.name }}_${{ runner.os }} | |
- name: Build Runik for windows | |
if: runner.os == 'Windows' | |
run: wails build --platform ${{ matrix.build.platform }} -o ${{ matrix.build.name }}_${{ runner.os }} -nsis | |
# Assign perms | |
- name: Apply macos perms | |
if: runner.os == 'macOS' | |
run: chmod +x build/bin/*/Contents/MacOS/* | |
# Zip macos App package | |
- name: Zip macos universal binary | |
if: runner.os == 'macOS' | |
run: | | |
cd build/bin | |
# TODO: Bundle .app into .dmg image | |
zip -r runik_mac_universal.zip "runik.app" | |
# Publish release | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
build/bin/* |