Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+encore.dev #2897

Merged
merged 4 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions projects/encore.dev/go/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
distributable: ~

versions:
github: encoredev/go
strip: /^encore-go/

provides:
- bin/go

interprets:
extensions: go
args: [go, run]

dependencies:
curl.se/ca-certs: '*'

companions:
tea.xyz/gx/cc: c99 # for `cgo`

warnings:
- vendored

runtime:
env:
ENCORE_GOROOT: ${{prefix}}

build:
dependencies:
curl.se: '*'
gnu.org/tar: '*'
script:
- curl -L https://github.com/encoredev/go/releases/download/encore-go{{version}}/$TYPE.tar.gz | tar zxvf -
- run: cp -a $SRCROOT/encore-go/* .
working-directory: ${{prefix}}
env:
linux/x86-64:
TYPE: linux_x86-64
linux/aarch64:
TYPE: linux_arm64
darwin/x86-64:
TYPE: macos_x86-64
darwin/aarch64:
TYPE: macos_arm64

test:
script: |
mv $FIXTURE $FIXTURE.go
OUTPUT=$(go run $FIXTURE.go)
test "Hello World" = "$OUTPUT"
fixture: |
package main
import "fmt"
func main() {
fmt.Println("Hello World")
}
42 changes: 42 additions & 0 deletions projects/encore.dev/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
distributable:
url: https://github.com/encoredev/encore/archive/refs/tags/v{{version}}.tar.gz
strip-components: 1

versions:
github: encoredev/encore

provides:
- bin/encore
- bin/git-remote-encore

runtime:
env:
ENCORE_RUNTIME_PATH: ${{prefix}}/runtime

dependencies:
encore.dev/go: ^1.21

build:
script:
- go mod download
- go build $ARGS -ldflags="$LDFLAGS" -o "{{prefix}}"/bin/encore ./cli/cmd/encore
- go build $ARGS -ldflags="$LDFLAGS" -o "{{prefix}}"/bin/git-remote-encore ./cli/cmd/git-remote-encore
- cp -a runtime {{prefix}}
env:
GO111MODULE: on
ARGS:
- -v
- -trimpath
LDFLAGS:
- -s
- -w
- -X 'encr.dev/internal/version.Version={{version}}'
linux:
# or segmentation fault
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
LDFLAGS:
- -buildmode=pie

test:
# test errors checking update api; looks like it still runs fine.
- (encore version || true) | grep {{version}}
Loading