Skip to content

update depends and bump up ver #2

update depends and bump up ver

update depends and bump up ver #2

Workflow file for this run

name: Wails build
on:
push:
tags:
- '*' # Match any new tag
env:
BUILD_DIR: "executables"
PROGRAM_NAME: "cultured_downloader"
NODE_OPTIONS: "--max-old-space-size=4096" # Necessary for most environments as build failure can occur due to OOM issues
jobs:
build:
permissions: write-all
strategy:
# Failure in one platform build won't impact the others
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Golang
uses: actions/setup-go@v5
with:
check-latest: true
go-version: "1.22"
- run: go version
shell: bash
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: latest
- name: node.js version
run: node --version
shell: bash
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
shell: bash
- name: Install Linux Wails deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.0-dev gcc-aarch64-linux-gnu
shell: bash
- name: Install macOS Wails deps
if: runner.os == 'macOS'
run: brew install mitchellh/gon/gon
shell: bash
# https://github.com/wailsapp/wails/issues/2290, -o flag doesn't work for macOS, uses the wails.json name instead
- name: Install jq for macOS
if: runner.os == 'macOS'
run: brew install jq
shell: bash
- name: Change macOS wails.json name
if: runner.os == 'macOS'
run: jq '.name = "${{ env.PROGRAM_NAME }}"' wails.json > tmp.$$.json && mv tmp.$$.json wails.json
shell: bash
- name: Build Linux App (x86_64)
if: runner.os == 'Linux'
working-directory: "."
run: |
echo "building on ${{ runner.os }} for x86_64"
wails build -platform "linux/amd64" -o "${{ env.PROGRAM_NAME }}_linux_x86_64"
echo "compressing linux app"
tar -czvf "./build/bin/${{ env.PROGRAM_NAME }}_linux_x86_64.tar.gz" "./build/bin/${{ env.PROGRAM_NAME }}_linux_x86_64"
rm "./build/bin/${{ env.PROGRAM_NAME }}_linux_x86_64"
echo "generating hash for ${{ env.PROGRAM_NAME }}_linux_x86_64.tar.gz"
sha256sum "./build/bin/${{ env.PROGRAM_NAME }}_linux_x86_64.tar.gz" | awk '{print $1}' > "./build/bin/sha256.txt"
HASH=$(cat "./build/bin/sha256.txt")
mv "./build/bin/sha256.txt" "./build/bin/_checksum_linux_x86_64-$HASH"
echo "hash generated: $HASH"
shell: bash
# Below is commented out due to cross-compilation issue in wails V2
# but should be fixed in wails V3, ref: https://github.com/wailsapp/wails/issues/2833
# - name: Build Linux App (arm64)
# if : runner.os == 'Linux'
# env:
# CC: aarch64-linux-gnu-gcc
# GOOS: linux
# GOARCH: arm64
# CGO_ENABLED: 1
# GOARM:
# GOMIPS:
# GOMIPS64:
# working-directory: "."
# run: |
# echo "building on ${{ runner.os }} for arm64"
# export CC=aarch64-linux-gnu-gcc
# wails build -skipbindings -platform "linux/arm64" -o "${{ env.PROGRAM_NAME }}_linux_arm64"
# echo "compressing linux app"
# tar -czvf "./build/bin/${{ env.PROGRAM_NAME }}_linux_arm64.tar.gz" "./build/bin/${{ env.PROGRAM_NAME }}_linux_arm64"
# rm "./build/bin/${{ env.PROGRAM_NAME }}_linux_arm64"
# echo "generating hash for ${{ env.PROGRAM_NAME }}_linux_arm64.tar.gz"
# sha256sum "./build/bin/${{ env.PROGRAM_NAME }}_linux_arm64.tar.gz" | awk '{print $1}' > "./build/bin/sha256.txt"
# HASH=$(cat "./build/bin/sha256.txt")
# mv "./build/bin/sha256.txt" "./build/bin/_checksum_linux_arm64-$HASH"
# echo "hash generated: $HASH"
- name: Build Windows App (x86_64)
if: runner.os == 'Windows'
working-directory: "."
run: |
echo "building on ${{ runner.os }} for x86_64"
wails build -platform "windows/amd64" -o "${{ env.PROGRAM_NAME }}_windows_x86_64.exe"
echo "compressing windows app for x86_64"
Compress-Archive -Path "./build/bin/${{ env.PROGRAM_NAME }}_windows_x86_64.exe" -DestinationPath "./build/bin/${{ env.PROGRAM_NAME }}_windows_x86_64.zip"
rm "./build/bin/${{ env.PROGRAM_NAME }}_windows_x86_64.exe"
echo "generating hash for ${{ env.PROGRAM_NAME }}_windows_x86_64.zip"
$HASH=(Get-FileHash -Algorithm SHA256 -Path "./build/bin/${{ env.PROGRAM_NAME }}_windows_x86_64.zip" | Select-Object -ExpandProperty Hash).ToLower()
$HASH | Set-Content -Path "./build/bin/_checksum_windows_x86_64-$HASH"
echo "hash generated: $HASH"
shell: powershell
- name: Build Windows App (arm64)
if: runner.os == 'Windows'
working-directory: "." # Note that upx doesn't work for arm64 builds on Windows
run: |
echo "building on ${{ runner.os }} for arm64"
wails build -platform "windows/arm64" -o "${{ env.PROGRAM_NAME }}_windows_arm64.exe"
echo "compressing windows app for arm64"
Compress-Archive -Path "./build/bin/${{ env.PROGRAM_NAME }}_windows_arm64.exe" -DestinationPath "./build/bin/${{ env.PROGRAM_NAME }}_windows_arm64.zip"
rm "./build/bin/${{ env.PROGRAM_NAME }}_windows_arm64.exe"
echo "generating hash for ${{ env.PROGRAM_NAME }}_windows_arm64.zip"
$HASH=(Get-FileHash -Algorithm SHA256 -Path "./build/bin/${{ env.PROGRAM_NAME }}_windows_arm64.zip" | Select-Object -ExpandProperty Hash).ToLower()
$HASH | Set-Content -Path "./build/bin/_checksum_windows_arm64-$HASH"
echo "hash generated: $HASH"
shell: powershell
- name: Build macOS App (x86_64)
working-directory: "."
if: runner.os == 'macOS'
run: |
echo "building on ${{ runner.os }} for x86_64"
wails build -platform "darwin/amd64"
echo "compressing macOS app"
cd "./build/bin/"
mv "./${{ env.PROGRAM_NAME }}.app" "./${{ env.PROGRAM_NAME }}_macos_x86_64.app"
tar -czvf "./${{ env.PROGRAM_NAME }}_macos_x86_64.tar.gz" "./${{ env.PROGRAM_NAME }}_macos_x86_64.app"
rm -rf "./${{ env.PROGRAM_NAME }}_macos_x86_64.app"
echo "generating hash for ${{ env.PROGRAM_NAME }}_macos_x86_64.tar.gz"
shasum -a 256 "./${{ env.PROGRAM_NAME }}_macos_x86_64.tar.gz" | cut -d ' ' -f 1 > "./sha256.txt"
HASH=$(cat "./sha256.txt")
mv "./sha256.txt" "./_checksum_macos_x86_64-$HASH"
echo "hash generated: $HASH"
shell: bash
- name: Build macOS App (arm64)
working-directory: "."
if: runner.os == 'macOS'
run: |
echo "building on ${{ runner.os }} for x86_64"
wails build -platform "darwin/arm64"
echo "compressing macOS app"
cd "./build/bin/"
mv "./${{ env.PROGRAM_NAME }}.app" "./${{ env.PROGRAM_NAME }}_macos_arm64.app"
tar -czvf "./${{ env.PROGRAM_NAME }}_macos_arm64.tar.gz" "./${{ env.PROGRAM_NAME }}_macos_arm64.app"
rm -rf "./${{ env.PROGRAM_NAME }}_macos_arm64.app"
echo "generating hash for ${{ env.PROGRAM_NAME }}_macos_arm64.tar.gz"
shasum -a 256 "./${{ env.PROGRAM_NAME }}_macos_arm64.tar.gz" | cut -d ' ' -f 1 > "./sha256.txt"
HASH=$(cat "./sha256.txt")
mv "./sha256.txt" "./_checksum_macos_arm64-$HASH"
echo "hash generated: $HASH"
shell: bash
- uses: actions/upload-artifact@v3
with:
name: Wails Build ${{runner.os}}
path: |
*/bin/
*\bin\*
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
*/bin/*