1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-18 01:50:50 +00:00

Update workflows

This commit is contained in:
Ash Keel 2022-11-23 22:33:23 +01:00
parent 7ba233dda4
commit 1268f7114b
No known key found for this signature in database
GPG key ID: BAD8D93E7314ED3E
2 changed files with 41 additions and 31 deletions

View file

@ -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

View file

@ -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 }}