Skip to content

build

build #5

Workflow file for this run

name: "build"
on:
workflow_dispatch:
jobs:
build:
name: "Build Calculator (${{ matrix.target.os }}, ${{ matrix.go-version }})"
runs-on: ${{ matrix.target.host || 'ubuntu-latest' }}
env:
GO111MODULE: on
strategy:
fail-fast: false
matrix:
# use max/min supported Go versions
go-version: ["1.21.x"]
target:
- os: linux
args: -arch amd64
- os: windows
ext: .exe
args: -arch amd64
# - os: freebsd
- os: android
args: |
-app-id calc.sha${{ github.sha }} \
-arch arm64
# - os: web
## Currently not easily supported from GitHub actions.
## https://github.com/fyne-io/fyne-cross/pull/104#issuecomment-1099494308
# - os: ios
# args: -app-id calc.sha${{ github.sha }}
# host: macos-latest
steps:
- name: Setup Go environment
id: setup-go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
with:
repository: fyne-io/fyne-cross
path: fyne-cross
- name: Checkout fyne-io/calculator
uses: actions/checkout@v2
with:
repository: fyne-io/calculator
path: calculator
- name: Cache build artifacts
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.cache/fyne-cross
key: ${{ runner.os }}-build-cache-${{ hashFiles('**/go.sum') }}
- name: Install Fyne-cross
working-directory: fyne-cross
run: go install
- name: Build
working-directory: calculator
run: |
fyne-cross \
${{ matrix.target.os }} \
${{ matrix.target.args }} \
-debug -no-cache \
-ldflags "-s -w" \
-name calculator${{ matrix.target.ext }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: fyne-cross
path: calculator/fyne-cross/dist/*