Skip to content

Commit

Permalink
feat: Add goreleaser GitHub Action to automatically generate binary o…
Browse files Browse the repository at this point in the history
…utput when new releases are created

See https://github.com/TsekNet/aukera/releases/tag/v1.0.2 for an example.

PiperOrigin-RevId: 418980265
  • Loading branch information
TsekNet authored and copybara-github committed Dec 30, 2021
1 parent f5f4c81 commit 7185779
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release

on:
push:
# Only create artifacts when there is a semantic-versioned release on GitHub (ex: v1.0.1)
tags:
- "v*"

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist -f .goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
# Custom environment variables to be set during the builds.
- env:
- CGO_ENABLED=0
# For more info refer to: https://golang.org/doc/install/source#environment
goos:
- linux
- windows
goarch:
- amd64
archives:
# Optionally override the matrix generation and specify only the final list of targets.
- format: binary
name_template: "{{ tolower .ProjectName }}_{{ .Os }}"
checksum:
name_template: "checksums.txt"
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Aukera

[![Go Tests](https://github.com/google/aukera/workflows/Go%20Tests/badge.svg)](https://github.com/google/aukera/actions?query=workflow%3A%22Go+Tests%22)
[![release](https://github.com/TsekNet/aukera/actions/workflows/release.yml/badge.svg)](https://github.com/TsekNet/aukera/actions/workflows/release.yml)

Aukera is a tool developed at Google for scheduling maintenance windows
discoverable via a local API.
Expand Down Expand Up @@ -32,7 +33,14 @@ afterward.

## Getting Started

Build It!
Pre-compiled binaries are available as
[release assets](https://github.com/google/aukera/releases).

Building Aukera manually:

1. Clone the repository
1. Install any missing imports with `go get -u`
1. Run `go build C:\Path\to\aukera\src`

## Disclaimer

Expand Down

0 comments on commit 7185779

Please sign in to comment.