Skip to content

Commit

Permalink
ci: Add release configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
staticaland committed Nov 15, 2023
1 parent 8bb2c17 commit 9a19efa
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:

push:
branches:
- main

jobs:

release-please:

permissions:
contents: write
pull-requests: write

runs-on: ubuntu-latest

outputs:
releases_created: ${{ steps.r.outputs.releases_created }}
tag_name: ${{ steps.r.outputs.tag_name }}

steps:

- uses: google-github-actions/release-please-action@db8f2c60ee802b3748b512940dde88eabd7b7e01 # v3.7.13
id: r
with:
release-type: go
package-name: ok
changelog-types: >
[
{"type": "deps", "section": "Dependency Updates", "hidden": false},
{"type": "feat", "section": "Features", "hidden": false},
{"type": "fix", "section": "Bug Fixes", "hidden": false}
]
goreleaser:

needs:
- release-please

if: needs.release-please.outputs.releases_created == 'true'

permissions:
contents: write

runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0


- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: "go.mod"
cache-dependency-path: "go.sum"


- name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# The changelog is managed by release-please
changelog:
skip: true

builds:
- binary: ok

brews:
- name: ok
description: A CLI called ok
homepage: https://github.com/oslokommune/ok
goarm: 6
goamd64: v3
tap:
owner: oslokommune
name: ok
folder: Formula
install: |
bin.install "ok"
34 changes: 34 additions & 0 deletions Formula/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:

push:

branches:
- main

jobs:

release-please:

name: Run release-please
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:

- name: Run Release Please
uses: google-github-actions/release-please-action@db8f2c60ee802b3748b512940dde88eabd7b7e01 # v3.7.13
id: r
with:
release-type: simple
package-name: reusable-docker-build-push
changelog-types: >
[
{"type": "deps", "section": "Dependency Updates", "hidden": false},
{"type": "feat", "section": "Features", "hidden": false},
{"type": "fix", "section": "Bug Fixes", "hidden": false}
]

0 comments on commit 9a19efa

Please sign in to comment.