Skip to content

Commit

Permalink
Merge pull request #119 from lucor/1.3.0
Browse files Browse the repository at this point in the history
Release 1.3.0
  • Loading branch information
lucor authored Jul 16, 2022
2 parents 3b7d423 + 733cb90 commit 250b55a
Show file tree
Hide file tree
Showing 22 changed files with 366 additions and 33 deletions.
105 changes: 95 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ on: [push, pull_request]

jobs:
lint:
name: Lint
runs-on: "ubuntu-latest"
steps:
- name: Setup Go environment
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: "1.15.x"
go-version: "1.18.x"

- name: Install staticcheck
run: go get -v honnef.co/go/tools/cmd/staticcheck
- name: Install goimports
run: go get -v golang.org/x/tools/cmd/goimports
- name: Install linters
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
# Checks-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
Expand All @@ -24,23 +25,107 @@ jobs:
- name: Run goimports
run: test -z $(find . -name '*.go' -type f | xargs goimports -e -d | tee /dev/stderr)
- name: Run staticcheck
run: staticcheck github.com/fyne-io/fyne-cross/...
run: staticcheck ./...

test:
name: "Test"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ["1.17.x", "1.14.x"]
# use max/min supported Go versions
go-version: ["1.18.x", "1.14.x"]

steps:
- name: Setup Go environment
uses: actions/setup-go@v2
id: setup-go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

# Checks-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2

# Run tests
- run: go test -race ./...
- run: go test -v -cover -race ./...

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.18.x", "1.14.x"]
target:
- os: linux
- os: windows
ext: .exe
- os: freebsd
- os: android
args: -app-id calc.${GITHUB_SHA}
- os: darwin
args: -app-id calc.${GITHUB_SHA}
host: macos-latest
- 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.${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:
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

# attempt to use "go install" but fallback to "go get"
- name: Install Fyne
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest ||
go get fyne.io/fyne/v2/cmd/fyne@latest
- name: Install Podman
if: ${{ runner.os == 'macos' }}
run: |
brew install podman
podman machine init
podman machine start
- name: Build
working-directory: calculator
run: |
fyne-cross \
${{ matrix.target.os }} \
${{ matrix.target.args }} \
-debug -no-cache \
-name calculator${{ matrix.target.ext }}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog - Fyne.io fyne-cross

## 1.3.0 - Unreleased

### Added

- Add support for web target #92
- Add CI job to build calculator app #104

### Changed

- Bump min Go version to 1.14 to align with Fyne requirements
- Update README for matching modern go command line #114

## 1.2.1 - 09 Apr 2022

### Added
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tag := $(shell date +"%y.%m.%d")
RUNNER := $(shell 2>/dev/null 1>&2 docker version && echo "docker" || echo "podman")
REGISTRY := docker.io
FYNE_CROSS_VERSION := "1.2"
FYNE_CROSS_VERSION := "1.3"


base:
Expand Down Expand Up @@ -31,8 +31,11 @@ linux: base
windows: base
@$(RUNNER) build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/windows/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows .

web: base
@$(RUNNER) build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/web/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-web .

# build all images for release. Note do not build darwin
build-images: base android freebsd linux windows
build-images: base android freebsd linux windows web
ifeq ($(RUNNER),podman)
$(MAKE) podman-tag
endif
Expand All @@ -54,6 +57,8 @@ tag-images:
@$(RUNNER) tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64 fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64-$(tag)
# tag windows images
@$(RUNNER) tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows-$(tag)
# tag web images
@$(RUNNER) tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-web fyneio/fyne-cross:${FYNE_CROSS_VERSION}-web-$(tag)

podman-tag:
# tag base images
Expand All @@ -71,6 +76,8 @@ podman-tag:
@$(RUNNER) tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64 $(REGISTRY)/fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64
# tag windows images
@$(RUNNER) tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows $(REGISTRY)/fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows
# tag web images
@$(RUNNER) tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-web $(REGISTRY)/fyneio/fyne-cross:${FYNE_CROSS_VERSION}-web


# push the latest images
Expand All @@ -85,6 +92,7 @@ push-latest-images:
@$(RUNNER) push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-amd64
@$(RUNNER) push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64
@$(RUNNER) push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows
@$(RUNNER) push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-web

# push the tagged images
push-tag-images:
Expand All @@ -98,6 +106,7 @@ push-tag-images:
@$(RUNNER) push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-amd64-$(tag)
@$(RUNNER) push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64-$(tag)
@$(RUNNER) push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows-$(tag)
@$(RUNNER) push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-web-$(tag)

# push all images: latest and tagged
push-images: push-latest-images push-tag-images
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@ Supported targets are:
## Requirements

- go >= 1.13
- go >= 1.14
- docker

### Installation

For go >= 1.16:
```
go get -u github.com/fyne-io/fyne-cross
go install github.com/fyne-io/fyne-cross@latest
```

For older go:
```
GO111MODULE=on go get -u github.com/fyne-io/fyne-cross
```

> `fyne-cross` will be installed in GOPATH/bin, unless GOBIN is set.
Expand Down
36 changes: 36 additions & 0 deletions docker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,41 @@

All notable changes to the fyne-cross docker images will be documented in this file.

## fyne 1.3.x compatible

Latest versions available on Docker Hub are:

- fyneio/fyne-cross:1.3-base
- fyneio/fyne-cross:1.3-base-llvm
- fyneio/fyne-cross:1.3-base-freebsd
- fyneio/fyne-cross:1.3-android
- fyneio/fyne-cross:1.3-freebsd-amd64
- fyneio/fyne-cross:1.3-freebsd-arm64
- fyneio/fyne-cross:1.3-linux-386
- fyneio/fyne-cross:1.3-linux-arm64
- fyneio/fyne-cross:1.3-linux-arm
- fyneio/fyne-cross:1.3-web
- fyneio/fyne-cross:1.3-windows

Release cycle won't follow the fyne-cross one, so the images will be tagged and
available on Docker Hub using the label year.month.day along with the tags
above.

Example: `fyneio/fyne-cross:1.3-base-22.06.23`

## Release 22.07.13
- Update Fyne CLI to v2.2.3
- Update Go to v1.18.4

## Release 22.07.01
- Update Fyne CLI to v2.2.2

## Release 22.06.23
- Add `web` base image
- Update freebsd to v12.3
- Update Go to v1.18.3
- Update Fyne CLI to v2.2.2-rc1

## fyne 1.2.x compatible

Latest versions available on Docker Hub are:
Expand All @@ -15,6 +50,7 @@ Latest versions available on Docker Hub are:
- fyneio/fyne-cross:1.2-linux-386
- fyneio/fyne-cross:1.2-linux-arm64
- fyneio/fyne-cross:1.2-linux-arm
- fyneio/fyne-cross:1.2-web
- fyneio/fyne-cross:1.2-windows

Release cycle won't follow the fyne-cross one, so the images will be tagged and
Expand Down
2 changes: 1 addition & 1 deletion docker/base-freebsd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN apt-get update -qq \

RUN mkdir -p /pkg-src \
&& mkdir -p /pkg/etc \
&& curl -L https://github.com/freebsd/pkg/archive/1.12.0.tar.gz | bsdtar -xf - -C /pkg-src \
&& curl -L https://github.com/freebsd/pkg/archive/1.18.2.tar.gz | bsdtar -xf - -C /pkg-src \
&& cd /pkg-src/pkg-* \
&& ./scripts/install_deps.sh \
&& ./configure --with-libarchive.pc --prefix=/pkg \
Expand Down
4 changes: 2 additions & 2 deletions docker/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG GO_VERSION=1.17.8
ARG GO_VERSION=1.18.4
# fyne stable branch
ARG FYNE_VERSION=v2.1.3
ARG FYNE_VERSION=v2.2.3

ARG FIXUID_VERSION=0.5.1

Expand Down
2 changes: 1 addition & 1 deletion docker/darwin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG LLVM_VERSION=12
ARG OSX_VERSION_MIN=10.12
ARG OSX_CROSS_COMMIT="8a716a43a72dab1db9630d7824ee0af3730cb8f9"
ARG FYNE_CROSS_VERSION=1.2
ARG FYNE_CROSS_VERSION=1.3

## Build osxcross toolchain
FROM docker.io/fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-llvm as osxcross
Expand Down
2 changes: 1 addition & 1 deletion docker/freebsd-amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-freebsd
ENV ABI="FreeBSD:12:amd64"
RUN mkdir /freebsd \
&& mkdir /etc/pkg/ \
&& curl https://download.freebsd.org/ftp/releases/amd64/12.2-RELEASE/base.txz | \
&& curl https://download.freebsd.org/ftp/releases/amd64/12.3-RELEASE/base.txz | \
bsdtar -xf - -C /freebsd ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc \
&& cp /freebsd/etc/pkg/FreeBSD.conf /etc/pkg/ \
&& ln -s /freebsd/usr/share/keys /usr/share/keys \
Expand Down
2 changes: 1 addition & 1 deletion docker/freebsd-arm64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-freebsd
ENV ABI="FreeBSD:12:aarch64"
RUN mkdir /freebsd \
&& mkdir /etc/pkg/ \
&& curl https://download.freebsd.org/ftp/releases/arm64/12.2-RELEASE/base.txz | \
&& curl https://download.freebsd.org/ftp/releases/arm64/12.3-RELEASE/base.txz | \
bsdtar -xf - -C /freebsd ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc \
&& cp /freebsd/etc/pkg/FreeBSD.conf /etc/pkg/ \
&& ln -s /freebsd/usr/share/keys /usr/share/keys
Expand Down
19 changes: 19 additions & 0 deletions docker/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG FYNE_CROSS_VERSION

ARG GOPHERJS_GO_VERSION=1.17.9

# fyne-cross image for web
FROM fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base
ARG GOPHERJS_GO_VERSION

# Install the GopherJS CLI tool
RUN go install -ldflags="-w -s" -v "github.com/gopherjs/gopherjs@latest"; \
mv /go/bin/gopherjs /usr/local/bin/gopherjs; \
# Install the Go version compatible with the GopherJS
go install golang.org/dl/go${GOPHERJS_GO_VERSION}@latest; \
go${GOPHERJS_GO_VERSION} download; \
rm /root/sdk/go${GOPHERJS_GO_VERSION}/*.tar.gz; \
mv /root/sdk/go${GOPHERJS_GO_VERSION} /usr/local; \
rm -rf /go/pkg

ENV GOPHERJS_GOROOT="/usr/local/go${GOPHERJS_GO_VERSION}"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/fyne-io/fyne-cross

go 1.13
go 1.14

require (
github.com/BurntSushi/toml v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion internal/command/android.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
// androidOS is the android OS name
androidOS = "android"
// androidImage is the fyne-cross image for the Android OS
androidImage = "docker.io/fyneio/fyne-cross:1.2-android"
androidImage = "docker.io/fyneio/fyne-cross:1.3-android"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/command/darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
// darwinArchSupported defines the supported target architectures on darwin
darwinArchSupported = []Architecture{ArchAmd64, ArchArm64}
// darwinImage is the fyne-cross image for the Darwin OS
darwinImage = "docker.io/fyneio/fyne-cross:1.2-darwin"
darwinImage = "docker.io/fyneio/fyne-cross:1.3-darwin"
)

// Darwin build and package the fyne app for the darwin OS
Expand Down
4 changes: 3 additions & 1 deletion internal/command/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func fynePackage(ctx Context) error {
// workDir default value
workDir := ctx.WorkDirContainer()

if ctx.OS == androidOS {
if ctx.OS == androidOS || ctx.OS == webOS {
workDir = volume.JoinPathContainer(workDir, ctx.Package)
}

Expand Down Expand Up @@ -322,6 +322,8 @@ func fyneRelease(ctx Context) error {
if ctx.Profile != "" {
args = append(args, "-profile", ctx.Profile)
}
case webOS:
workDir = volume.JoinPathContainer(workDir, ctx.Package)
case windowsOS:
if ctx.Certificate != "" {
args = append(args, "-certificate", ctx.Certificate)
Expand Down
Loading

0 comments on commit 250b55a

Please sign in to comment.