Skip to content

Commit

Permalink
Pull version information from build process (#16)
Browse files Browse the repository at this point in the history
* Pull version information from build process

* Update deps
  • Loading branch information
sethvargo authored Oct 11, 2022
1 parent 5debf9d commit 9a9f52a
Show file tree
Hide file tree
Showing 8 changed files with 310 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: '1.16'
go-version: '1.19'

- uses: actions/cache@v2
with:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2022 the Cloud Run Proxy Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'release'

on:
push:
tags:
- 'v*'

permissions:
contents: 'write'
packages: 'write'

jobs:
release:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
with:
fetch-depth: 0

- uses: 'actions/setup-go@v3'
with:
go-version: '1.19'

- uses: 'goreleaser/goreleaser-action@v3'
with:
version: 'latest'
args: 'release --rm-dist'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
61 changes: 61 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2022 the Cloud Run Proxy Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

before:
hooks:
- 'go mod tidy'

builds:
-
env:
- 'CGO_ENABLED=0'
- 'GO111MODULE=on'
- 'GOPROXY=https://proxy.golang.org,direct'
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- '-a'
- '-trimpath'
ldflags:
- '-s'
- '-w'
- '-X={{ .ModulePath }}/internal/version.Name=cloud-run-proxy'
- '-X={{ .ModulePath }}/internal/version.Version={{ .Version }}'
- '-X={{ .ModulePath }}/internal/version.Commit={{ .Commit }}'
- '-extldflags=-static'
goos:
- 'darwin'
- 'linux'
- 'windows'
goarch:
- 'amd64'
- 'arm64'
binary: 'cloud-run-proxy'

archives:
- format: 'tar.gz'
name_template: 'cloud-run-proxy_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
format_overrides:
- goos: 'windows'
format: 'zip'

checksum:
name_template: 'cloud-run-proxy_{{ .Version }}_SHA512SUMS'
algorithm: 'sha512'

changelog:
use: 'github'

release:
draft: false
mode: 'replace'
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ SDK](https://cloud.google.com/sdk) (gcloud) for the proxy to pull your
authentication token. You local user must also have Cloud Run Invoker
permissions on the target service.

1. Install the proxy:
1. Install the proxy from the [Releases](releases) page or manually:

```sh
go install github.com/GoogleCloudPlatform/cloud-run-proxy@latest
go install github.com/GoogleCloudPlatform/cloud-run-proxy@main
```

1. Start the proxy:
Expand Down
37 changes: 12 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
// Copyright 2021 the Cloud Run Proxy Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

module github.com/GoogleCloudPlatform/cloud-run-proxy

go 1.17
go 1.19

require (
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
google.golang.org/api v0.61.0
golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1
google.golang.org/api v0.98.0
)

require (
cloud.google.com/go v0.99.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
cloud.google.com/go/compute v1.10.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/net v0.0.0-20221004154528-8021a29435af // indirect
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect
golang.org/x/text v0.3.8 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0 // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e // indirect
google.golang.org/grpc v1.50.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
Loading

0 comments on commit 9a9f52a

Please sign in to comment.