From bac69b98b13a5617d3ce69fee1bf05d82089919b Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Mon, 14 Aug 2023 10:45:11 -0400 Subject: [PATCH 1/5] bump SDK to version 0.2.0 --- README.md | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f45fe86..480b48c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This starter is intentionally lightweight, and requires no dependencies aside fr The starter doesn't require the use of any backends. Once deployed, you will have a Fastly service running on Compute@Edge that can generate synthetic responses at the edge. -It is recommended to use the [Fastly CLI](https://github.com/fastly/cli) for this template. The template uses the `fastly.toml` scripts, to allow for building the project using your installed TinyGo compiler. The Fastly CLI should also be used for serving and testing your build output, as well as deploying your finalized package! +It is recommended to use the [Fastly CLI](https://github.com/fastly/cli) for this template. The template uses the `fastly.toml` scripts, to allow for building the project using your installed Go or TinyGo compiler. The Fastly CLI should also be used for serving and testing your build output, as well as deploying your finalized package! ## Security issues diff --git a/go.mod b/go.mod index 263329f..e92f061 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module compute-starter-kit-go go 1.17 -require github.com/fastly/compute-sdk-go v0.1.7 +require github.com/fastly/compute-sdk-go v0.2.0 diff --git a/go.sum b/go.sum index 6341be7..c99ec01 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/fastly/compute-sdk-go v0.1.7 h1:DyyneozpIdCn4d/5P9FY0zuMrhEi7ZLV7OwGYtcpgzs= -github.com/fastly/compute-sdk-go v0.1.7/go.mod h1:FkuTq3OC+czAQOonII04YhiVjfBtMXOuv3hiHjXjHlE= +github.com/fastly/compute-sdk-go v0.2.0 h1:jSzWhtKSbSvoqrpOnBcQEPxf85ED29VWruTqLZgAulE= +github.com/fastly/compute-sdk-go v0.2.0/go.mod h1:FkuTq3OC+czAQOonII04YhiVjfBtMXOuv3hiHjXjHlE= From 40537f567d8c971f1dfaa9c7782f047d23a39049 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Tue, 15 Aug 2023 16:47:13 -0400 Subject: [PATCH 2/5] build using the standard Go toolchain --- README.md | 2 +- fastly.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 480b48c..250d11d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This starter is intentionally lightweight, and requires no dependencies aside fr The starter doesn't require the use of any backends. Once deployed, you will have a Fastly service running on Compute@Edge that can generate synthetic responses at the edge. -It is recommended to use the [Fastly CLI](https://github.com/fastly/cli) for this template. The template uses the `fastly.toml` scripts, to allow for building the project using your installed Go or TinyGo compiler. The Fastly CLI should also be used for serving and testing your build output, as well as deploying your finalized package! +It is recommended to use the [Fastly CLI](https://github.com/fastly/cli) for this template. The template uses the `fastly.toml` scripts, to allow for building the project using your installed Go compiler. The Fastly CLI should also be used for serving and testing your build output, as well as deploying your finalized package! ## Security issues diff --git a/fastly.toml b/fastly.toml index b9ff58e..c0ea7fd 100644 --- a/fastly.toml +++ b/fastly.toml @@ -6,3 +6,6 @@ description = "A basic starter kit that demonstrates routing, simple synthetic r language = "go" manifest_version = 3 name = "Default starter for Go" + +[scripts] + build = "env GOARCH=wasm GOOS=wasip1 go build -o bin/main.wasm ." From 2ff58a97f4bfffec22b3cdd58dcc0943ceea35c7 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Wed, 16 Aug 2023 15:23:00 -0400 Subject: [PATCH 3/5] setup GitHub Actions for CI Builds against latest stable Go on Ubuntu, MacOS, and Windows --- .github/workflows/test.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..44dd7d4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +on: pull_request +name: Test +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 'stable' + check-latest: true + - name: Setup Fastly CLI + uses: fastly/compute-actions/setup@v5 + - name: Build and test + uses: fastly/compute-actions/build@v5 + with: + verbose: true From cb3236dcaaa16d691acc6654aeb5481d92e83281 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Fri, 18 Aug 2023 16:41:30 -0400 Subject: [PATCH 4/5] use `scripts.env_vars` to specify GOARCH/GOOS --- fastly.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastly.toml b/fastly.toml index c0ea7fd..a9d662e 100644 --- a/fastly.toml +++ b/fastly.toml @@ -8,4 +8,5 @@ manifest_version = 3 name = "Default starter for Go" [scripts] - build = "env GOARCH=wasm GOOS=wasip1 go build -o bin/main.wasm ." + env_vars = ["GOARCH=wasm", "GOOS=wasip1"] + build = "go build -o bin/main.wasm ." From 6d4b4222fe7f2ac64cc0fc3cb5eaa826517a5b18 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Wed, 13 Sep 2023 12:40:47 -0400 Subject: [PATCH 5/5] bump SDK to 1.0.0 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e92f061..bbb97f6 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module compute-starter-kit-go go 1.17 -require github.com/fastly/compute-sdk-go v0.2.0 +require github.com/fastly/compute-sdk-go v1.0.0 diff --git a/go.sum b/go.sum index c99ec01..9f8bb79 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,4 @@ github.com/fastly/compute-sdk-go v0.2.0 h1:jSzWhtKSbSvoqrpOnBcQEPxf85ED29VWruTqLZgAulE= github.com/fastly/compute-sdk-go v0.2.0/go.mod h1:FkuTq3OC+czAQOonII04YhiVjfBtMXOuv3hiHjXjHlE= +github.com/fastly/compute-sdk-go v1.0.0 h1:uURhhPXAvX5hbkPIbfJQ/lZTxtHuL/Y0dyN9nMnV9Zk= +github.com/fastly/compute-sdk-go v1.0.0/go.mod h1:FkuTq3OC+czAQOonII04YhiVjfBtMXOuv3hiHjXjHlE=