Skip to content

Commit

Permalink
feat: add goreleaser and github action
Browse files Browse the repository at this point in the history
  • Loading branch information
kidsan committed Nov 9, 2021
1 parent 6cde5e3 commit 4138456
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 7 deletions.
40 changes: 33 additions & 7 deletions .github/workflows/learn-github-actions.yml
@@ -1,12 +1,38 @@
name: learn-github-actions
on: [push]
name: release
on:
push:
branches: [master]
jobs:
check-bats-version:
release:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: go
package-name: german
bump-minor-pre-major: true

- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install -g bats
- run: bats -v
fetch-depth: 0
if: ${{ steps.release.outputs.release_created }}

- uses: actions/setup-go@v2
with:
go-version: '1.16'
if: ${{ steps.release.outputs.release_created }}

- name: Clean working directory
run: git checkout . && git clean -f
if: ${{ steps.release.outputs.release_created }}

- name: Create binaries, containers and GitHub release
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
25 changes: 25 additions & 0 deletions .goreleaser.yml
@@ -0,0 +1,25 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
release:
name_template: "{{.ProjectName}}-v{{.Version}}"

0 comments on commit 4138456

Please sign in to comment.