Skip to content

Commit

Permalink
Merge pull request #1679 from goplus/main
Browse files Browse the repository at this point in the history
v1.2.0-pre.2
  • Loading branch information
xushiwei committed Jan 28, 2024
2 parents 86242de + fdeda2d commit d9639c6
Show file tree
Hide file tree
Showing 83 changed files with 3,402 additions and 721 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
git config --global user.name "build robot"
go test -v cmd/make_test.go
- name: Compile gop and related tools
run: go install ./...

- name: Run testcases
run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./...

Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2

- name: Checkout tag
run: |
Expand All @@ -35,12 +40,23 @@ jobs:
with:
go-version: "1.21"

- name: Install goreleaser
run: |
go install github.com/goreleaser/goreleaser@latest
- name: Release
- name: Release with goreleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean -p 4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WINGET_PKGS_PRIVATE_KEY: ${{ secrets.WINGET_PKGS_PRIVATE_KEY }}
run: goreleaser release -p 4

- name: Upload deb/rpm to Fury.io
run: |
for file in dist/*.{deb,rpm}
do
echo "Uploading $file to Fury.io"
curl -sS -F package=@$file https://[email protected]/goplus/
done
env:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
160 changes: 159 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,25 @@ changelog:
- "^test:"

winget:
- name: gop
- name: goplus
homepage: "https://goplus.org/"
publisher: goplus
publisher_url: https://github.com/goplus/gop
publisher_support_url: "https://github.com/goplus/gop/issues/new"
package_identifier: goplus.gop
path: "manifests/g/goplus/gop/{{.Version}}"
tags:
- golang
- go
- gop
- goplus
- programming
- language
- compiler
- interpreter
- data science
- engineering
- education
short_description: The Go+ Programming Language
description: |
The Go+ programming language is designed for engineering, STEM education, and data science.
Expand Down Expand Up @@ -101,3 +114,148 @@ winget:
owner: microsoft
name: winget-pkgs
branch: master

nfpms:
- package_name: gop
vendor: goplus
homepage: https://goplus.org/
maintainer: Li Jie <[email protected]>
license: Apache-2.0
description: |
The Go+ programming language is designed for engineering, STEM education, and data science.
- For engineering: working in the simplest language that can be mastered by children.
- For STEM education: studying an engineering language that can be used for work in the future.
- For data science: communicating with engineers in the same language.
formats:
- "deb"
- "rpm"
overrides:
deb:
dependencies:
- "golang-go (>= 1.18.0)"
rpm:
dependencies:
- "golang-bin >= 1.18.0"
file_name_template: >-
{{ .ProjectName }}_v{{.Version}}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
bindir: /usr/lib/{{ .ProjectName }}
contents:
# source folder
- src: LICENSE
dst: /usr/lib/{{ .ProjectName }}/LICENSE
- src: "README.md"
dst: /usr/lib/{{ .ProjectName }}/README.md
- src: "go.mod"
dst: /usr/lib/{{ .ProjectName }}/go.mod
- src: "go.sum"
dst: /usr/lib/{{ .ProjectName }}/go.sum
- src: "*.go"
dst: /usr/lib/{{ .ProjectName }}/
- src: ast
dst: /usr/lib/{{ .ProjectName }}/ast
- src: builtin
dst: /usr/lib/{{ .ProjectName }}/builtin
- src: cl
dst: /usr/lib/{{ .ProjectName }}/cl
- src: cmd
dst: /usr/lib/{{ .ProjectName }}/cmd
- src: doc
dst: /usr/lib/{{ .ProjectName }}/doc
- src: env
dst: /usr/lib/{{ .ProjectName }}/env
- src: format
dst: /usr/lib/{{ .ProjectName }}/format
- src: parser
dst: /usr/lib/{{ .ProjectName }}/parser
- src: printer
dst: /usr/lib/{{ .ProjectName }}/parser
- src: scanner
dst: /usr/lib/{{ .ProjectName }}/scanner
- src: token
dst: /usr/lib/{{ .ProjectName }}/token
- src: watcher
dst: /usr/lib/{{ .ProjectName }}/watcher
- src: "x"
dst: /usr/lib/{{ .ProjectName }}/x
# symlinks to binaries
- src: "/usr/lib/{{ .ProjectName }}/bin/gop"
dst: /usr/bin/gop
type: symlink
- src: "/usr/lib/{{ .ProjectName }}/bin/gopfmt"
dst: /usr/bin/gopfmt
type: symlink

snapcrafts:
- id: gop
name: gop
title: The Go+ Programming Language
summary: The Go+ Programming Language
description: |
The Go+ programming language is designed for engineering, STEM education, and data science.
- For engineering: working in the simplest language that can be mastered by children.
- For STEM education: studying an engineering language that can be used for work in the future.
- For data science: communicating with engineers in the same language.
confinement: classic
license: Apache-2.0
name_template: >-
{{ .ProjectName }}_v{{.Version}}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
extra_files:
# source folder
- source: LICENSE
destination: LICENSE
- source: "README.md"
destination: README.md
- source: "go.mod"
destination: go.mod
- source: "go.sum"
destination: go.sum
- source: ast
destination: ast
- source: builtin
destination: builtin
- source: cl
destination: cl
- source: cmd
destination: cmd
- source: doc
destination: doc
- source: env
destination: env
- source: format
destination: format
- source: parser
destination: parser
- source: printer
destination: parser
- source: scanner
destination: scanner
- source: token
destination: token
- source: watcher
destination: watcher
- source: "x"
destination: x
apps:
gop:
command: "gop"
aliases: ["gop"]
environment:
GOPROOT: "$SNAP"
gopfmt:
command: "gopfmt"
aliases: ["gopfmt"]
environment:
GOPROOT: "$SNAP"

checksum:
name_template: "{{ .ProjectName }}_v{{ .Version }}_checksums.txt"
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,41 @@ For more details, see [Quick Start](doc/docs.md).

## How to install

### on Windows

```sh
winget install goplus
```

Or

```sh
winget install goplus.gop
```

### on Debian/Ubuntu

```sh
sudo bash -c ' echo "deb [trusted=yes] https://pkgs.goplus.org/apt/ /" > /etc/apt/sources.list.d/goplus.list'
sudo apt update
sudo apt install gop
```

### on RedHat/CentOS/Fedora

```sh
sudo bash -c 'echo -e "[goplus]\nname=Go+ Repo\nbaseurl=https://pkgs.goplus.org/yum/\nenabled=1\ngpgcheck=0" > /etc/yum.repos.d/goplus.repo'
sudo yum install gop
```

### on macOS/Linux(Homebrew)

Install via [brew](https://brew.sh/)

```sh
$ brew install goplus
```

### from source code

For now, we suggest you install Go+ from source code.
Expand All @@ -63,14 +98,6 @@ cd gop
all.bat
```

### on macOS/Linux

Install via [brew](https://brew.sh/)
```sh
$ brew install goplus
```


## Go+ Applications

### 2D Games powered by Go+
Expand Down
2 changes: 1 addition & 1 deletion all.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

set -ex

go run cmd/make.go --install --autoproxy
go run cmd/make.go --install --regtest --autoproxy
2 changes: 1 addition & 1 deletion all.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
go run cmd/make.go --install --autoproxy
go run cmd/make.go --install --regtest --autoproxy
10 changes: 2 additions & 8 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,6 @@ type (
Elt Expr // ellipsis element type (parameter lists only); or nil
}

// A BasicLit node represents a literal of basic type.
BasicLit struct {
ValuePos token.Pos // literal position
Kind token.Token // token.INT, token.FLOAT, token.IMAG, token.CHAR, token.STRING or token.CSTRING
Value string // literal string; e.g. 42, 0x7f, 3.14, 1e-9, 2.4i, 'a', '\x7f', "foo" or `\m\n\o`
}

// A FuncLit node represents a function literal.
FuncLit struct {
Type *FuncType // function type
Expand Down Expand Up @@ -1060,6 +1053,7 @@ type (
Body *BlockStmt // function body; or nil for external (non-Go) function
Operator bool // is operator or not
Shadow bool // is a shadow entry
IsClass bool // recv set by class
}
)

Expand Down Expand Up @@ -1141,7 +1135,7 @@ type File struct {
}

// There is no entrypoint func to indicate the module entry point.
func (f *File) NoEntrypoint() bool {
func (f *File) HasShadowEntry() bool {
return f.ShadowEntry != nil
}

Expand Down
Loading

0 comments on commit d9639c6

Please sign in to comment.