Skip to content

Commit

Permalink
Merge pull request #176 from fyne-io/releases/v1.4.0-rc1
Browse files Browse the repository at this point in the history
Releases/v1.4.0 rc1
  • Loading branch information
Bluebugs committed Mar 29, 2023
2 parents 250b55a + e521163 commit 4fbae90
Show file tree
Hide file tree
Showing 55 changed files with 3,524 additions and 2,521 deletions.
125 changes: 115 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: "1.18.x"
go-version: "1.19.x"

- name: Install linters
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest

# Checks-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
Expand Down Expand Up @@ -48,6 +48,28 @@ jobs:

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

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

steps:
- name: Setup Go environment
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 build -tags k8s

build:
name: "Build Calculator (${{ matrix.target.os }}, ${{ matrix.go-version }})"
Expand All @@ -65,16 +87,17 @@ jobs:
ext: .exe
- os: freebsd
- os: android
args: -app-id calc.${GITHUB_SHA}
- os: darwin
args: -app-id calc.${GITHUB_SHA}
host: macos-latest
args: -app-id calc.sha${{ github.sha }}
## Not shared darwin image is available at the moment
# - os: darwin
# args: -app-id calc.sha${{ 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}
# args: -app-id calc.sha${{ github.sha }}
# host: macos-latest

steps:
Expand Down Expand Up @@ -129,3 +152,85 @@ jobs:
${{ matrix.target.args }} \
-debug -no-cache \
-name calculator${{ matrix.target.ext }}
build-fyneterm:
name: "Build Fyneterm (${{ 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.sha${{ github.sha }}
## Not shared darwin image is available at the moment
# - os: darwin
# args: -app-id calc.sha${{ 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.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:
path: fyne-cross

- name: Checkout fyne-io/terminal
uses: actions/checkout@v2
with:
repository: fyne-io/terminal
path: terminal

- 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: terminal
run: |
fyne-cross \
${{ matrix.target.os }} \
${{ matrix.target.args }} \
-debug \
-name fyneterm${{ matrix.target.ext }} cmd/fyneterm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/fyne-cross
/internal/cmd/fyne-cross-s3/fyne-cross-s3
/*.dmg
/*.xip
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# Changelog - Fyne.io fyne-cross

## 1.3.0 - Unreleased
## 1.4.0 - 13 Mar 2023

### Added

- Add support for Kubernetes
- Add ability to specify a different registry
- Support for fyne metadata

### Changed

- Pull image from fyne-cross-image repository
- Simplify `fyne-cross darwin-sdk-extract` by getting the needed files from the Apple SDK and then mounting them in the container image for each build
- Provide a darwin image and mount the SDK from the host
- Use `fyne build` for all targets

## 1.3.0 - 16 Jul 2022

### Added

- Add support for web target #92
- Add CI job to build calculator app #104
- Add CI job to build calculator app #104
- Add support to macOS 12.x and 13.x SDKs via darwin image (osxcross) #133

### Changed

Expand Down
115 changes: 0 additions & 115 deletions Makefile

This file was deleted.

35 changes: 12 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ Supported targets are:
> - macOS packaging for public distrubution (release mode) is supported only on darwin hosts.
> - windows packaging for public distrubution (release mode) is supported only on windows hosts.
> - starting from v1.1.0:
> - cross-compile from NOT `darwin` (i.e. linux) to `darwin`: the image with the macOS SDK is no more available via docker hub and has to be built manually, see the [Build the darwin image](#build_darwin_image) section below.
> - cross-compile from NOT `darwin` (i.e. linux) to `darwin`: requires a copy of the macOS SDK on the host. The fyne-cross `darwin-sdk-extractor` command can be used to extract the SDK from the XCode CLI Tool file, see the [Extract the macOS SDK](#extract_macos_sdk) section below.
> - cross-compile from `darwin` to `darwin` by default will use under the hood the fyne CLI tool and requires Go and the macOS SDK installed on the host.
> - starting from v1.4.0, Arm64 hosts are supported for all platforms except Android.
## Requirements

Expand All @@ -45,6 +46,11 @@ For go >= 1.16:
go install github.com/fyne-io/fyne-cross@latest
```

To install a fyne-cross with kubernetes engine support:
```
go install -tags k8s github.com/fyne-io/fyne-cross@latest
```

For older go:
```
GO111MODULE=on go get -u github.com/fyne-io/fyne-cross
Expand Down Expand Up @@ -124,33 +130,16 @@ fyne-cross linux
fyne-cross linux -output bugs ./cmd/bugs
```

## <a name="build_darwin_image"></a>Build the docker image for OSX/Darwin/Apple cross-compiling
The docker image for darwin is not provided via docker hub and need to build manually since it depends on the macOS SDK.
## <a name="extract_macos_sdk"></a>Extract the macOS SDK for OSX/Darwin/Apple cross-compiling
cross-compile from NOT `darwin` (i.e. linux) to `darwin` requires a copy of the macOS SDK on the host.
The fyne-cross `darwin-sdk-extractor` command can be used to extract the SDK from the XCode CLI Tool file.

**[Please ensure you have read and understood the Xcode license
terms before continuing.](https://www.apple.com/legal/sla/docs/xcode.pdf)**

To build the image:
To extract the SDKs:
1. [Download Command Line Tools for Xcode](https://developer.apple.com/download/all/?q=Command%20Line%20Tools) >= 12.4 (macOS SDK 11.x)
2. Run: `fyne-cross darwin-image --xcode-path /path/to/Command_Line_Tools_for_Xcode_12.5.dmg`

The command above will:
- install the dependencies required by [osxcross](https://github.com/tpoechtrager/osxcross) to package the macOS SDK and compile the macOS cross toolchain.
- package the macOS SDK
- compile the macOS cross toolchain
- build the `fyneio/fyne-cross:<ver>-darwin` image that will be used by fyne-cross

> NOTE: the creation of the image may take several minutes and may require more than 25 GB of free disk space.
### [EXPERIMENTAL] Build using a different SDK version

By default fyne-cross will attempt to auto-detect the latest version of SDK provided by the Xcode package. If for any reason a different SDK version is required, it can be specified using the `--sdk-version` flag.

Example:

`fyne-cross darwin-image --sdk-version 11.1 --xcode-path /path/to/Command_Line_Tools_for_Xcode_12.4.dmg`

> Note: this feature is marked as EXPERIMENTAL
2. Run: `fyne-cross darwin-sdk-extract --xcode-path /path/to/Command_Line_Tools_for_Xcode_12.5.dmg`

## Contribute

Expand Down
Loading

0 comments on commit 4fbae90

Please sign in to comment.