Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
ci(goreleaser): add goreleaser github action
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonBirchall committed Apr 29, 2022
1 parent 8caffee commit d0154b8
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/create-release.yaml
Expand Up @@ -2,27 +2,32 @@
name: "Create a release"
on:
push:
# run only against tags
tags:
- v*
- "*"

permissions:
contents: write

jobs:
release:
if: startsWith(github.ref, 'refs/tags/')
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
- name: Checkout
uses: actions/checkout@v2
with:
commitMode: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: actions/create-release@v1
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{steps.github_release.outputs.changelog}}
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d0154b8

Please sign in to comment.