From 148fc053ce98709b19498d499ea9d30fac786ddf Mon Sep 17 00:00:00 2001 From: Jeremy Chang Date: Tue, 22 Mar 2022 19:00:53 +0000 Subject: [PATCH 1/4] feat: Update release-please version, add r-p config for Go and Go publish CI - Updated release-please to latest v3 from v2 that contains the needed functionality for releasing Go SDK. The breaking changes should not affect us: https://github.com/google-github-actions/release-please-action/releases/tag/v3.0.0 - Setup release-please config to release Go SDK at v0 only.-- To release Go SDK at v1 and above requires automated editing of the module name in go.mod during SDK generation or when release-please creates a release PR. Release-please gi thub issue: https://github.com/googleapis/release-please/issues/1344 -- The repo tag must be in the exact format of "go/vX.X.X". So package-name and tag-separator in release-please-config.json are set accordingly - Setup release-please-manifest to point go sdk to 0.0.1. 0.0.0 is automatically bumped to 1.0.0 ignoring the "pre-major" release-please configs. - Setup a go publish github action that publishes go module to go proxy based off the new tag - Updated go.mod and go.sum with go mod tidy which cleans up dependencies --- go/go.mod | 1 + go/go.sum | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/go/go.mod b/go/go.mod index 1c1dbb92a..3a7303949 100644 --- a/go/go.mod +++ b/go/go.mod @@ -4,5 +4,6 @@ go 1.14 require ( github.com/json-iterator/go v1.1.12 + github.com/smartystreets/goconvey v1.7.2 // indirect gopkg.in/ini.v1 v1.61.0 ) diff --git a/go/go.sum b/go/go.sum index 23fb3dcd1..c2f39fb63 100644 --- a/go/go.sum +++ b/go/go.sum @@ -1,14 +1,30 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= +github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= +github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10= gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= From 8c37e55e97078e122f1e46c6163745d63e1aa4bf Mon Sep 17 00:00:00 2001 From: Jeremy Chang Date: Tue, 22 Mar 2022 19:10:11 +0000 Subject: [PATCH 2/4] . --- .github/workflows/go-publish.yml | 40 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 2 +- .release-please-manifest.json | 3 ++- release-please-config.json | 3 ++- 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/go-publish.yml diff --git a/.github/workflows/go-publish.yml b/.github/workflows/go-publish.yml new file mode 100644 index 000000000..17baaf129 --- /dev/null +++ b/.github/workflows/go-publish.yml @@ -0,0 +1,40 @@ +name: Publish Go module to Go proxy +on: + release: + types: published + + workflow_dispatch: + inputs: + ref: + description: 'commit/tag/branch to release from' + required: true + +defaults: + run: + shell: bash + working-directory: go/ + +jobs: + publish: + if: > + (github.event.inputs) || + (startsWith(github.event.release.tag_name, 'go') && + !github.event.release.draft && + !github.event.release.prerelease) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.release.tag_name || github.event.inputs.ref }} + + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: '1.18' + + # Assumes tag_name is "go/vX.X.X" and splits off "go/"" + # `go list` only accepts version as "vX.X.X" + - name: Publish https://go.dev/doc/modules/publishing + run: | + version=$(echo ${{github.event.release.tag_name}} | cut -d/ -f2) + GOPROXY=proxy.golang.org go list -m github.com/looker-open-source/sdk-codegen/go@$version diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 03a85e1e8..b315d3993 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -8,7 +8,7 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@b1f383133aa4cc90eca1d35ae7ac7d96c1e83d72 + - uses: google-github-actions/release-please-action@v3 with: command: manifest monorepo-tags: true diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c572630fd..07caf621b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -15,5 +15,6 @@ "packages/sdk-node": "22.2.0", "packages/sdk-rtl": "21.3.1", "packages/wholly-sheet": "0.5.25", - "python": "22.2.1" + "python": "22.2.1", + "go": "0.0.1" } diff --git a/release-please-config.json b/release-please-config.json index 106d38067..d9e23b6e5 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -19,6 +19,7 @@ "packages/sdk-node": { }, "packages/sdk-rtl": { "release-as": "" }, "packages/wholly-sheet": { "release-as": "" }, - "python": { "release-type": "python", "package-name": "looker_sdk" } + "python": { "release-type": "python", "package-name": "looker_sdk" }, + "go": { "release-type": "go", "package-name": "go", "tag-separator": "/" } } } From 0f582e693f1ecc47979353d4eee0e25cabdcde94 Mon Sep 17 00:00:00 2001 From: jeremytchang <78522362+jeremytchang@users.noreply.github.com> Date: Tue, 22 Mar 2022 14:34:10 -0700 Subject: [PATCH 3/4] Update release-please-config.json Co-authored-by: Joel Dodge --- release-please-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-please-config.json b/release-please-config.json index d9e23b6e5..e388c107c 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -20,6 +20,6 @@ "packages/sdk-rtl": { "release-as": "" }, "packages/wholly-sheet": { "release-as": "" }, "python": { "release-type": "python", "package-name": "looker_sdk" }, - "go": { "release-type": "go", "package-name": "go", "tag-separator": "/" } + "go": { "release-type": "go", "package-name": "go", "tag-separator": "/" } } } From 59caa5700bf854f4178df4642f562a566d1a68c0 Mon Sep 17 00:00:00 2001 From: Jeremy Chang Date: Tue, 22 Mar 2022 21:40:31 +0000 Subject: [PATCH 4/4] Added release-as for go --- release-please-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-please-config.json b/release-please-config.json index e388c107c..d7e635b0f 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -20,6 +20,6 @@ "packages/sdk-rtl": { "release-as": "" }, "packages/wholly-sheet": { "release-as": "" }, "python": { "release-type": "python", "package-name": "looker_sdk" }, - "go": { "release-type": "go", "package-name": "go", "tag-separator": "/" } + "go": { "release-as": "", "release-type": "go", "package-name": "go", "tag-separator": "/" } } }