From 1268f7114bbcc473fea091cf1a85422dfad3161b Mon Sep 17 00:00:00 2001 From: Ash Keel Date: Wed, 23 Nov 2022 22:33:23 +0100 Subject: [PATCH] Update workflows --- .github/workflows/build.yml | 35 +++++++++++++++++++++++++-------- .github/workflows/release.yml | 37 +++++++++++++---------------------- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66c0f91..374e8ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,11 +20,30 @@ jobs: uses: actions/setup-node@v1 with: node-version: 14.x - - name: Build frontend - run: | - cd frontend - npm install - npm run build - - name: Build app - run: | - go build . + - name: Install Wails + if: inputs.build == 'true' + run: go install github.com/wailsapp/wails/v2/cmd/wails@${{inputs.wails-version}} + shell: bash + - name: Install Linux Wails deps + if: inputs.build == 'true' && 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 + - name: Build App + if: inputs.build == 'true' && runner.os == 'macOS' + working-directory: ${{ inputs.app-working-directory }} + run: wails build --platform ${{inputs.build-platform}} -webview2 ${{inputs.wails-build-webview2}} -o ${{inputs.build-name}} + shell: bash + - name: Build App + if: inputs.build == 'true' && runner.os == 'Linux' + working-directory: ${{ inputs.app-working-directory }} + run: wails build --platform ${{inputs.build-platform}} -webview2 ${{inputs.wails-build-webview2}} -o ${{inputs.build-name}} + shell: bash + - name: Build App + if: inputs.build == 'true' && runner.os == 'Windows' + working-directory: ${{ inputs.app-working-directory }} + run: wails build --platform ${{inputs.build-platform}} -webview2 ${{inputs.wails-build-webview2}} -o ${{inputs.build-name}} + shell: bash \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85cdbad..aee2c67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,29 +7,20 @@ on: jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + build: [ + {name: strimertul, platform: linux/amd64, os: ubuntu-latest}, + {name: strimertul, platform: windows/amd64, os: windows-latest}, + {name: strimertul, platform: darwin/universal, os: macos-latest} + ] + runs-on: ${{ matrix.build.os }} steps: - - uses: actions/checkout@v1 - - name: Setup Go environment - uses: actions/setup-go@v2.1.4 + - uses: actions/checkout@v2 with: - go-version: 1.18 - - name: Setup Node.js - uses: actions/setup-node@v1 + submodules: recursive + - uses: dAppServer/wails-build-action@v2 with: - node-version: 14.x - - name: Build frontend - run: | - cd frontend - npm install - npm run build - - name: Build app for all platforms - run: | - go install github.com/mitchellh/gox@latest - gox -arch="amd64 arm" -os "windows linux" -ldflags "-X 'main.appVersion=`git describe --tags --always`'" - - name: Create release - uses: softprops/action-gh-release@v1 - with: - prerelease: true - files: | - strimertul_* + build-name: ${{ matrix.build.name }} + build-platform: ${{ matrix.build.platform }}