Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
refaktor authored Oct 9, 2024
2 parents 2645cf5 + 3257805 commit 406f690
Show file tree
Hide file tree
Showing 10 changed files with 301 additions and 14 deletions.
123 changes: 123 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: build-release

on:
push:
# branches:
# - 'main'
tags:
- 'v*'
# pull_request:

permissions:
contents: write
packages: write

jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22.0
cache: true
- run: go install fyne.io/fyne/v2/cmd/fyne@latest
- run: go mod tidy
- run: go build -o rye-fyne.exe
- uses: actions/upload-artifact@v4
with:
name: rye-fyne-windows-amd64
path: rye-fyne.exe

build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22.0
cache: true
- run: sudo apt update && sudo apt install gcc libegl1-mesa-dev xorg-dev
- run: go install fyne.io/fyne/v2/cmd/fyne@latest
- run: go mod tidy
- run: go build -o rye-fyne
- run: tar czf rye-fyne-linux-amd64.tar.gz rye-fyne
- uses: actions/upload-artifact@v4
with:
name: rye-fyne-linux-amd64
path: rye-fyne-linux-amd64.tar.gz

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22.0
cache: true
- run: go install fyne.io/fyne/v2/cmd/fyne@latest
- run: go mod tidy
- run: go build -o rye-fyne
- run: tar czf rye-fyne-macos-amd64.tar.gz rye-fyne
- uses: actions/upload-artifact@v4
with:
name: rye-fyne-macos-amd64
path: rye-fyne-macos-amd64.tar.gz

release:
runs-on: ubuntu-latest
needs: [build-macos, build-windows, build-linux]
steps:

- uses: actions/download-artifact@v4
with:
name: rye-fyne-linux-amd64

- uses: actions/download-artifact@v4
with:
name: rye-fyne-windows-amd64

- uses: actions/download-artifact@v4
with:
name: rye-fyne-macos-amd64

- uses: actions/create-release@v1
id: create-new-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./rye-fyne.exe
asset_name: rye-fyne.exe
asset_content_type: application/vnd.microsoft.portable-executable

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./rye-fyne-linux-amd64.tar.gz
asset_name: rye-fyne-linux-amd64.tar.gz
asset_content_type: application/x-gtar

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./rye-fyne-macos-amd64.tar.gz
asset_name: rye-fyne-macos-amd64.tar.gz
asset_content_type: application/x-gtar
72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: build

on:
push:
# branches:
# - 'main'
tags:
- 'testbuild*'
# pull_request:

permissions:
contents: write
packages: write

jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22.0
cache: true
- run: go install fyne.io/fyne/v2/cmd/fyne@latest
- run: go mod tidy
- run: go build -o rye-fyne.exe
- uses: actions/upload-artifact@v4
with:
name: rye-fyne
path: rye-fyne.exe

build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22.0
cache: true
- run: sudo apt update && sudo apt install gcc libegl1-mesa-dev xorg-dev
- run: go install fyne.io/fyne/v2/cmd/fyne@latest
- run: go mod tidy
- run: go build -o rye-fyne
- run: tar czf rye-fyne-linux-amd64.tar.gz rye-fyne
- uses: actions/upload-artifact@v4
with:
name: rye-fyne-linux-amd64
path: rye-fyne-linux-amd64.tar.xz

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.22.0
cache: true
- run: go install fyne.io/fyne/v2/cmd/fyne@latest
- run: go mod tidy
- run: go build -o rye-fyne
- run: tar czf rye-fyne-macos-amd64.tar.gz rye-fyne
- uses: actions/upload-artifact@v4
with:
name: rye-fyne-macos-amd64
path: rye-fyne-macos-amd64.tar.xz

68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: build

on:
push:
# branches:
# - 'main'
tags:
- 'testrelease*'
# pull_request:

permissions:
contents: write
packages: write

jobs:
release:
runs-on: ubuntu-latest
# needs: [build-windows, build-linux, build-macos]
steps:
- uses: ./.github/workflows/build.yml
- name: Create GitHub Release

- uses: actions/download-artifact@v4
with:
name: rye-fyne-linux-amd64

- uses: actions/download-artifact@v4
with:
name: rye-fyne-windows-amd64

- uses: actions/download-artifact@v4
with:
name: rye-fyne-macos-amd64

- uses: actions/create-release@v1
id: create-new-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./rye-fyne-windows-amd64.exe
asset_name: rye-fyne-windows-amd64.exe
asset_content_type: application/vnd.microsoft.portable-executable

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./rye-fyne-linux-amd64.tar.xz
asset_name: rye-fyne-linux-amd64.tar.xz
asset_content_type: application/x-gtar

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: ./rye-fyne-macos-amd64.tar.gz
asset_name: rye-fyne-macos-amd64.tar.gz
asset_content_type: application/x-gtar
5 changes: 5 additions & 0 deletions FyneApp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Details]
Icon = "Icon.png"
Name = "rye-fyne"
ID = "org.ryelang.rye-fyne"
Build = 11
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,46 @@ we have great emphasis on **interactive use** (Rye shell) where we will explore

**[Rye language repository](https://github.com/refaktor/rye)** | **[Rye website](https://ryelang.org/)** | **[Reddit group](https://reddit.com/r/ryelang/)**

### Why a separate repository
## Download Rye-Fyne

* So Rye remains lighter on dependencies, easier to build, focused on backend and interactive shell
* So that "frontend" related development is separated from language development
* So that we test and improve on how users of Rye can externally extend it, add their own (private) bindings and write their own Go (private) builtin functions for hot-code optimization
Download the binary:
* Linux: [rye-fyne-linux-amd64.tar.gz](https://github.com/refaktor/rye-fyne/releases/download/23/rye-fyne-linux-amd64.tar.gz)
* MacOS: [rye-fyne-macos-amd64.tar.gz](https://github.com/refaktor/rye-fyne/releases/download/23/rye-fyne-macos-amd64.tar.gz)
* Windows: [rye-fyne.exe](https://github.com/refaktor/rye-fyne/releases/download/23/rye-fyne.exe)

#### Build and test
This includes just the binary (executable), to download examples you should still need to download ZIP from the github. In future
we will make the binary download all required things itself if raw with `rye install`.

You need [Go](https://go.dev/) installed. Please follow Go's installation instructions for your opearating system.
## Building Rye-Fyne

In **rye-fyne** directory run:
You need [Go](https://go.dev/) installed. Please follow Go's installation instructions for your opearating system.

```
# To get rye-fyne use "Download ZIP" from "<> Code" button
# on the github page: https://github.com/refaktor/rye-fyne
# or use Git:
git clone https://github.com/refaktor/rye-fyne.git
# enter directory
cd rye-fyne
# build rye with fyne in bin/fyne/rye
./build
# Try the hello example
bin/rye examples/fyne/button.rye
bin/rye-fyne examples/fyne/button.rye
# Try the feedback example
bin/rye examples/fyne/feedback.rye
bin/rye-fyne examples/fyne/feedback.rye
# Try the Live GUI demo
bin/rye examples/fyne/live.rye
bin/rye-fyne examples/fyne/live.rye
# Or enter the Rye console
bin/rye-fyne
x> cc fyne
x> app .window "Hello" |set-content label "world" |show-and-run
(Ctrl-c to exit)
```

#### Example
Expand Down
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
go build -tags "b_fyne" -o bin/rye
go build -tags "b_fyne" -o bin/rye-fyne
1 change: 1 addition & 0 deletions cmd/rye-fyne/empty
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion examples/hello.rye
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ do\in fyne {
|set-content v-box [
lab1
separator
lab2
labela
sld1
ent1
btn1
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ module github.com/refaktor/rye-front

go 1.23

toolchain go1.23.0
// toolchain go1.23.0

replace github.com/refaktor/rye => ../rye

replace github.com/refaktor/ryegen => ../ryegen
// replace github.com/refaktor/ryegen => ../ryegen

require (
fyne.io/fyne/v2 v2.4.4
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/refaktor/rye-front/current"
"github.com/refaktor/rye/env"
"github.com/refaktor/rye/runner"
"github.com/jwalton/go-supportscolor"
)

/* type TagType int
Expand All @@ -31,6 +32,7 @@ type node struct {

func main() {

supportscolor.Stdout()
runner.DoMain(func(ps *env.ProgramState) {
current.RegisterBuiltins(ps)
})
Expand Down

0 comments on commit 406f690

Please sign in to comment.