diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 885f6df..b6435d8 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,12 +1,12 @@ -name: build +name: build-release on: push: - branches: - - 'main' + # branches: + # - 'main' tags: - - 'testbuild*' - pull_request: + - 'v*' + # pull_request: permissions: contents: write @@ -25,8 +25,99 @@ jobs: cache: true - run: go install fyne.io/fyne/v2/cmd/fyne@latest - run: go mod tidy - - run: fyne package --release + - run: go build -o rye-fyne.exe - uses: actions/upload-artifact@v4 with: - name: rye-fyne + 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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..136cbf2 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d0670b6 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/README.md b/README.md index 7d6a85c..3841133 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/main.go b/main.go index 228fa4a..1408a6c 100644 --- a/main.go +++ b/main.go @@ -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 @@ -31,6 +32,7 @@ type node struct { func main() { + supportscolor.Stdout() runner.DoMain(func(ps *env.ProgramState) { current.RegisterBuiltins(ps) })