Skip to content

Commit

Permalink
Add release workflow & license headers (bazelbuild#938)
Browse files Browse the repository at this point in the history
* Add go releaser config

* Minor change

* Remove tags

* Add tag script

* chmod

* fix script

* release config update

* remove tag script

* comments & license headers
  • Loading branch information
smukherj1 committed Feb 9, 2021
1 parent 9ae2560 commit 0b4a7f4
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2021 The Bazel Authors. All rights reserved.
#
# 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.
#
# Triggers a new Github release via Github Actions
# (https://docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions) and
# using Go releaser (https://github.com/goreleaser/goreleaser) whenever a new tag is created in this
# repository. The goal is to release pre-built binaries of the Go CLI tools hosted in this repo.
# See .goreleaser.yml for the Go releaser config.
name: goreleaser

# Trigger only when a new tag is created.
on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 changes: 52 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2021 The Bazel Authors. All rights reserved.
#
# 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.
#
# goreleaser config. See http://goreleaser.com for details. Builds and releases the Bazel C++/Java
# remote execution toolchain generator as pre-built binaries.
before:
# Make Go pre-download all dependencies before building any binaries to avoid clobbering parallel
# builds.
hooks:
- go mod download
builds:
- id: rbe_configs_gen
env:
main: ./cmd/rbe_configs_gen/rbe_configs_gen.go
binary: rbe_configs_gen
goos:
- linux
# Windows is untested.
- windows
goarch:
- amd64
# Set the binary timestamp to the commit timestamp it's being
# built from to make the produced binaries deterministic.
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
-
# Only upload binary assets.
format: binary
# Define how the prebuilt binaries uploaded as release assets are named. The default includes the
# version string in the binary name which is redundant because it is already included in the
# release asset's URL.
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"

checksum:
name_template: 'checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
14 changes: 14 additions & 0 deletions cmd/rbe_configs_gen/rbe_configs_gen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 The Bazel Authors. All rights reserved.
//
// 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.
//
// Binary rbe_configs_gen provides the ability to generate toolchain targets along with a default
// platform target to configure Bazel to run actions remotely.
package main
Expand Down
14 changes: 14 additions & 0 deletions cmd/rbe_configs_upload/rbe_configs_upload.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 The Bazel Authors. All rights reserved.
//
// 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.
//
// Binary rbe_configs_upload uploads the artifacts generated by rbe_configs_gen to GCS. This tool
// is meant for internal use by the owners of this repository only.
// This tool will upload the given configs tarball & manifest to the following paths on GCS:
Expand Down
14 changes: 14 additions & 0 deletions pkg/rbeconfigsgen/options.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 The Bazel Authors. All rights reserved.
//
// 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.
//
// Package rbeconfigsgen contains utilities to generate C++ & Java Toolchain configs for Bazel to be
// used to run RBE builds
package rbeconfigsgen
Expand Down
14 changes: 14 additions & 0 deletions pkg/rbeconfigsgen/rbeconfigsgen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 The Bazel Authors. All rights reserved.
//
// 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.
//
package rbeconfigsgen

import (
Expand Down

0 comments on commit 0b4a7f4

Please sign in to comment.