Skip to content

Commit

Permalink
ci: add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
dhth committed Mar 3, 2024
1 parent 5e1d312 commit 81ba8b9
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Go build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.0'

- name: Build
run: go build -v ./...
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.0'
- name: Build
run: go build -v ./...
- name: Install Cosign
uses: sigstore/cosign-installer@v3
with:
cosign-release: 'v2.2.3'
- name: Store Cosign private key in a file
run: 'echo "$COSIGN_KEY" > cosign.key'
shell: bash
env:
COSIGN_KEY: ${{secrets.COSIGN_KEY}}
- name: Release Binaries
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{secrets.GH_PAT}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
43 changes: 43 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 1

before:
hooks:
- go mod tidy
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin

signs:
- cmd: cosign
stdin: "{{ .Env.COSIGN_PASSWORD }}"
args:
- "sign-blob"
- "--key=cosign.key"
- "--output-signature=${signature}"
- "${artifact}"
- "--yes" # needed on cosign 2.0.0+
artifacts: all


brews:
- name: outtasync
repository:
owner: dhth
name: homebrew-tap
folder: Formula
license: MIT
homepage: "https://github.com/dhth/outtasync"
description: "Quickly identify CloudFormation stacks that have gone out of sync with their counterpart stack files"

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---

`outtasync` helps users quickly identify the CloudFormation stacks that have
gone out of sync from the state represented by their counterpart stack files.
gone out of sync with the state represented by their counterpart stack files.
This can occur when someone updates a stack but fails to commit the latest stack
file to the codebase. Alternatively, it may happen when a stack is updated on
one deployment environment but not on others. 🤷
Expand Down

0 comments on commit 81ba8b9

Please sign in to comment.